Skip to content

Instantly share code, notes, and snippets.

View ScottIsAFool's full-sized avatar

Scott Lovegrove ScottIsAFool

View GitHub Profile
@ScottIsAFool
ScottIsAFool / SystemTrayProgressIndicatorBehaviour.cs
Created April 3, 2014 08:59
A behaviour to allow you to have a custom colour for the system tray's progressindicator
using System;
using System.ComponentModel;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Interactivity;
using System.Windows.Media;
using Microsoft.Phone.Controls;
using Microsoft.Phone.Shell;
namespace ScottIsAFool.WindowsPhone.Behaviours
@ScottIsAFool
ScottIsAFool / SlideViewFrame.cs
Created March 16, 2014 18:16
Hide appbar when using SlideView
using System;
using System.Windows;
using Microsoft.Phone.Controls;
using System.Windows.Controls;
namespace SlideView.Library
{
[TemplatePart(Name = SlideViewName, Type = typeof(SlideView))]
public class SlideApplicationFrame : TransitionFrame
{
@ScottIsAFool
ScottIsAFool / TimeZoneHelper.cs
Last active August 29, 2015 13:56
TimeZoneHelper for Windows Phone
using System;
using System.Collections.Generic;
using Newtonsoft.Json;
namespace ScottIsAFool.WindowsPhone.Helpers
{
public static class TimeZoneHelper
{
private const string TimeZonesJson = "[{\"Name\":\"(UTC-12:00) International Date Line West\",\"Offset\":\"-12:00:00\"},{\"Name\":\"(UTC-11:00) Co-ordinated Universal Time-11\",\"Offset\":\"-11:00:00\"},{\"Name\":\"(UTC-10:00) Hawaii\",\"Offset\":\"-10:00:00\"},{\"Name\":\"(UTC-09:00) Alaska\",\"Offset\":\"-09:00:00\"},{\"Name\":\"(UTC-08:00) Baja California\",\"Offset\":\"-08:00:00\"},{\"Name\":\"(UTC-08:00) Pacific Time (US & Canada)\",\"Offset\":\"-08:00:00\"},{\"Name\":\"(UTC-07:00) Arizona\",\"Offset\":\"-07:00:00\"},{\"Name\":\"(UTC-07:00) Chihuahua, La Paz, Mazatlan\",\"Offset\":\"-07:00:00\"},{\"Name\":\"(UTC-07:00) Mountain Time (US & Canada)\",\"Offset\":\"-07:00:00\"},{\"Name\":\"(UTC-06:00) Central America\",\"Offset\":\"-06:00:00\"},{\"Name\":\"(UTC-06:00) Central Time (US & Canada)\",\"Offset\":\"-06:00:00\"},{\"Name\":\"(UTC-0
@ScottIsAFool
ScottIsAFool / TimeZone.cs
Created February 9, 2014 21:04
Holds all the timezones as well as their offsets, for platforms that don't have http://msdn.microsoft.com/en-us/library/system.timezoneinfo.getsystemtimezones(v=vs.110).aspx (like Windows Phone)
using Newtonsoft.Json;
namespace TimeZones
{
public class TimeZone
{
[JsonProperty("Name")]
public string Name { get; set; }
[JsonProperty("Offset")]
using System;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media.Imaging;
namespace ScottIsAFool.WindowsPhone.Bindings
{
public class ScaledImageSource
{
public static object GetSource(DependencyObject obj)
@ScottIsAFool
ScottIsAFool / BooleanToValueConverter.cs
Last active December 16, 2015 17:18
A base converter that can be used to create converters that require a true/false value.
using System;
using System.Windows.Data;
namespace ScottIsAFool.WindowsPhone.Converters
{
public class BoolToValueConverter<T> : IValueConverter
{
public T FalseValue { get; set; }
public T TrueValue { get; set; }