Skip to content

Instantly share code, notes, and snippets.

View Keboo's full-sized avatar

Kevin B Keboo

View GitHub Profile
@Keboo
Keboo / DrawerHost.xaml
Created May 17, 2017 17:29
An example left drawer that takes up space rather than overlaying the content using MDIX
<ControlTemplate TargetType="{x:Type local:MyDrawerHost}">
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
<VisualStateManager.VisualStateGroups>
<VisualStateGroup x:Name="LeftDrawer">
<VisualStateGroup.Transitions>
<VisualTransition From="LeftDrawerClosed" To="LeftDrawerOpen">
<Storyboard>
<ThicknessAnimationUsingKeyFrames Storyboard.TargetProperty="Margin" Storyboard.TargetName="PART_LeftDrawer">
<EasingThicknessKeyFrame Value="0" KeyTime="0:0:0.4">
<EasingThicknessKeyFrame.EasingFunction>
@Keboo
Keboo / MultiBinding.cs
Last active September 17, 2020 07:18
A simple MultiBinding class for Xamarin.Forms. This "binding" only works when directly applied to an element.
/*
WARNING: This MultiBinding implementation only works when it is directly applied to its target property.
It will fail if used inside of a setter (such is the case when used within a trigger or style).
*/
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Globalization;
using System.Linq;
using System.Runtime.CompilerServices;
@Keboo
Keboo / SpekkCheck.csx
Last active December 4, 2015 06:32
Serialize Spell Check
#r "C:\Dev\microsoft\packages\Newtonsoft.Json.7.0.1\lib\portable-net45+wp80+win8+wpa81+dnxcore50\Newtonsoft.Json.dll"
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Net;
using System.Threading.Tasks;
using Newtonsoft.Json;
public class Spell
@Keboo
Keboo / ExceptionFiltersFizzBuzz.cs
Created March 24, 2015 04:45
An example of C# exception filter.
using Microsoft.VisualStudio.TestTools.UnitTesting;
using System;
using static System.Diagnostics.Debug;
namespace Example
{
[TestClass]
public class ExceptionFiltersFizzBuzz
{
[TestMethod]