Skip to content

Instantly share code, notes, and snippets.

Avatar

Martin Suchan martinsuchan

View GitHub Profile
@martinsuchan
martinsuchan / Cursor.cs
Created Jul 18, 2017
CoreCursor attached property helper class.
View Cursor.cs
using System.Collections.Generic;
using System.Diagnostics;
using Windows.UI.Core;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Input;
namespace CursorTest
{
public class Cursor : DependencyObject
{
View Setting.cs
using System;
using System.Diagnostics;
using Windows.Storage;
namespace TinyCore.Storage
{
public abstract class SettingBase
{
/// <summary>
/// Access to LocalSettings must be atomic.
@martinsuchan
martinsuchan / MainPage.xam
Created Apr 20, 2016
Broken SecondaryCommands when using AppBarButton->Style
View MainPage.xam
<Page x:Class="App1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Page.Resources>
<SolidColorBrush x:Key="AppBarForegroundBrush" Color="DarkBlue"/>
<Style x:Key="MyAppBarButtonStyle" TargetType="AppBarButton">
@martinsuchan
martinsuchan / ScreenSizeHelper.cs
Created Jan 21, 2016
Lumia 950 and 950 XL screen size detection on WP8.1 Silverlight
View ScreenSizeHelper.cs
using System;
using System.Diagnostics;
using System.Linq;
using System.Windows;
using Microsoft.Phone.Info;
namespace PhoneApp1
{
public class ScreenSizeHelper
{
@martinsuchan
martinsuchan / MainPage.xaml.cs
Created Jan 11, 2014
Baseball Odds - different JSON parsing methods.
View MainPage.xaml.cs
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Runtime.Serialization;
using System.Windows;
using System.Windows.Resources;
using Newtonsoft.Json;
using Newtonsoft.Json.Linq;
@martinsuchan
martinsuchan / Class1.cs
Created Jul 15, 2014
Visual Studio 14 CTP2 C# notes
View Class1.cs
using System;
// Using static
using System.Diagnostics.Debug;
using System.Math;
using System.Linq.Enumerable;
using System.Collections.Generic;
#if NETFX_CORE
using Windows.Web.Http;
#else
using System.Net.Http;
@martinsuchan
martinsuchan / MainPage.xaml
Created Feb 6, 2014
AppBarButton exceptions in Windows 8.1
View MainPage.xaml
<Page x:Class="BlankApp1.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Page.Resources>
<!-- this works -->
<Style x:Key="Style1" TargetType="AppBarButton">
<Setter Property="Icon" Value="Previous" />
</Style>
<!-- these throw exception -->