Skip to content

Instantly share code, notes, and snippets.

View peterfoot's full-sized avatar

Peter Foot peterfoot

View GitHub Profile
@peterfoot
peterfoot / MainPage.xaml
Created November 11, 2016 00:34
DialASketch
<Page
x:Class="DialASketch.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:local="using:DialASketch"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d">
<Page.TopAppBar>
<CommandBar>
@peterfoot
peterfoot / SingleTapButtonRender.cs
Created May 5, 2016 19:38
Single Tap Xamarin Forms Button Renderer for Android
using Android.Views;
[assembly: Xamarin.Forms.ExportRenderer(typeof(Xamarin.Forms.Button), typeof(InTheHand.Forms.Platform.Android.SingleTapButtonRenderer))]
namespace InTheHand.Forms.Platform.Android
{
public sealed class SingleTapButtonRenderer : Xamarin.Forms.Platform.Android.ButtonRenderer
{
bool justClicked = false;
public override bool OnFilterTouchEventForSecurity(MotionEvent e)
@peterfoot
peterfoot / OnPlatform2.cs
Created October 13, 2015 19:25
Replacement for Xamarin.Forms.OnPlatform which supports the Windows (WinRT) platforms.
namespace InTheHand.Forms
{
/// <summary>
/// Replacement for Xamarin.Forms.OnPlatform which supports the Windows (WinRT) platforms.
/// </summary>
/// <typeparam name="T"></typeparam>
public sealed class OnPlatform2<T>
{
public OnPlatform2()
{
namespace InTheHand.Net
{
/// <summary>
/// Helper network-order conversion functions for the Universal Windows Platform.
/// </summary>
public static class IPAddress
{
/// <summary>
/// Converts a short value from network byte order to host byte order.
/// </summary>
using System;
namespace InTheHand
{
/// <summary>
/// Helper class for DateTimeOffset.
/// </summary>
public static class DateTimeOffsetHelper
{
private static DateTimeOffset dt = new DateTimeOffset(1970, 1, 1, 0, 0, 0, TimeSpan.Zero);