Skip to content

Instantly share code, notes, and snippets.

View jamesmundy's full-sized avatar

James Mundy jamesmundy

View GitHub Profile
@jamesmundy
jamesmundy / TwitterXAML
Created December 4, 2014 11:12
Twitter Logo in XAML Path form.
<?xml version="1.0" encoding="utf-8"?>
<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" x:Name="Social" Width="100" Height="100" Clip="F1 M 0,0L 100,0L 100,100L 0,100L 0,0">
<Canvas x:Name="Layer_1" Width="100" Height="100" Canvas.Left="0" Canvas.Top="0"/>
<Canvas x:Name="Layer_3" Width="100" Height="100" Canvas.Left="0" Canvas.Top="0">
<Path x:Name="Path" Width="87.7429" Height="71.1726" Canvas.Left="4.53067" Canvas.Top="12.0773" Stretch="Fill" Fill="#FF000000" Data="F1 M 81.9902,23.3536C 85.9196,20.929 88.5391,17.6454 89.8002,13.4297C 85.9683,15.4767 82.1608,16.8595 78.3533,17.6454C 74.9235,13.9537 70.5921,12.0773 65.3835,12.0773C 60.315,12.0773 56.0079,13.8623 52.505,17.3347C 49.0082,20.8315 47.2477,25.0715 47.2477,30.0426C 47.2477,31.5412 47.4365,32.8754 47.8203,34.0146C 32.8279,33.515 20.4307,27.3073 10.647,15.3365C 9.00828,18.2607 8.17368,21.2397 8.17368,24.3344C 8.17368,30.664 10.842,35.6838 16.1968,39.3694C 13.1508,39.
at Foundation.NSObject.InitializeHandle (IntPtr handle, System.String initSelector) [0x00094] in /Developer/MonoTouch/Source/maccore/src/Foundation/NSObject2.cs:463
at SVGKitBindings.SVGKFastImageView..ctor () [0x0004e] in /Users/james/Documents/GitHub/SVGKit.Xamarin/SVGKitBindings/SVGKitBindings/obj/Debug/ios/SVGKitBindings/SVGKFastImageView.g.cs:112
at Pinpoint.iPhone.MainViewController.ViewDidLoad () [0x0020f] in /Users/james/Documents/GitHub/Game/iOS/Pinpoint.iPhone/Pinpoint.iPhone/MainViewController.cs:40
at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:62
at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Developer/MonoTouch/Source/monotouch/src/UIKit/UIApplication.cs:46
at Pinpoint.iPhone.Applicat
@jamesmundy
jamesmundy / SimpleListBox
Created March 10, 2015 10:45
A simple coloured ListBox.
<Grid>
<ListBox Background="Black" ScrollViewer.HorizontalScrollBarVisibility="Auto" ScrollViewer.VerticalScrollBarVisibility="Disabled">
<ListBoxItem Width="100" Height="100" Foreground="White" Background="AntiqueWhite" Content="ListBoxItem"/>
<ListBoxItem Width="100" Height="100" Foreground="White" Background="Blue" Content="ListBoxItem"/>
<ListBoxItem Width="100" Height="100" Foreground="White" Background="Chartreuse" Content="ListBoxItem"/>
<ListBoxItem Width="100" Height="100" Foreground="White" Background="DarkGoldenrod" Content="ListBoxItem"/>
<ListBoxItem Width="100" Height="100" Foreground="White" Background="Firebrick" Content="ListBoxItem"/>
<ListBoxItem Width="100" Height="100" Foreground="White" Background="Gainsboro" Content="ListBoxItem"/>
<ListBoxItem Width="100" Height="100" Foreground="White" Background="HotPink" Content="ListBoxItem"/>
<ListBoxItem Width="100" Height="100" Foreground="White" Backg
@jamesmundy
jamesmundy / ItemsPanelTemplate
Created March 10, 2015 11:13
Default template for the ListBox's ItemsPanelTemplate
<ItemsPanelTemplate x:Key="ItemsPanelTemplate">
<VirtualizingStackPanel />
</ItemsPanelTemplate>
@jamesmundy
jamesmundy / HorizontalItemsPanelTemplate
Created March 10, 2015 11:17
Horizontal ItemsPanel template for ListBox.
<ItemsPanelTemplate x:Key="ItemsPanelTemplate">
<VirtualizingStackPanel Orientation="Horizontal" />
</ItemsPanelTemplate>
@jamesmundy
jamesmundy / ListBoxStyle
Created March 10, 2015 11:25
The default style of the Windows Phone 8.1 ListBox
<Style x:Key="ListBoxStyle" TargetType="ListBox">
<Setter Property="Foreground" Value="{ThemeResource ListBoxForegroundThemeBrush}"/>
<Setter Property="Background" Value="{ThemeResource ListBoxBackgroundThemeBrush}"/>
<Setter Property="BorderBrush" Value="{ThemeResource ListBoxBorderThemeBrush}"/>
<Setter Property="BorderThickness" Value="{ThemeResource ListBoxBorderThemeThickness}"/>
<Setter Property="ScrollViewer.HorizontalScrollBarVisibility" Value="Disabled"/>
<Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto"/>
<Setter Property="ScrollViewer.HorizontalScrollMode" Value="Disabled"/>
<Setter Property="ScrollViewer.VerticalScrollMode" Value="Auto"/>
<Setter Property="ScrollViewer.ZoomMode" Value="Disabled"/>
<ScrollViewer x:Name="ScrollViewer" AutomationProperties.AccessibilityView="Raw" BringIntoViewOnFocusChange="{TemplateBinding ScrollViewer.BringIntoViewOnFocusChange}" HorizontalScrollBarVisibility="{TemplateBinding ScrollViewer.HorizontalScrollBarVisibility}" IsHorizontalRailEnabled="{TemplateBinding ScrollViewer.IsHorizontalRailEnabled}" IsVerticalRailEnabled="{TemplateBinding ScrollViewer.IsVerticalRailEnabled}" IsDeferredScrollingEnabled="{TemplateBinding ScrollViewer.IsDeferredScrollingEnabled}" Padding="{TemplateBinding Padding}" TabNavigation="{TemplateBinding TabNavigation}" VerticalScrollBarVisibility="{TemplateBinding ScrollViewer.VerticalScrollBarVisibility}" ZoomMode="{TemplateBinding ScrollViewer.ZoomMode}" VerticalScrollMode="Disabled">
<ItemsPresenter/>
</ScrollViewer>
@jamesmundy
jamesmundy / MKMapViewZoomLevel.cs
Last active January 21, 2016 14:17 — forked from djad442/MKMapViewZoomLevel.cs
MonoTouch MKMapView with Zoom Level Property
using System;
using MapKit;
using CoreLocation;
using CoreGraphics;
using System.Drawing;
using Foundation;
namespace BinaryQuest
{
[Register("MKMapViewZoomLevel")]
public class TestSample
{
public int HighestProductOfThree(int[] arrayOfInts)
{
if (arrayOfInts.Length < 3)
throw new ArgumentException("Less than 3 items!");
// We're going to start at the 3rd item (at index 2)
// so pre-populate highests and lowests based on the first 2 items.
// we could also start these as null and check below if they're set
@jamesmundy
jamesmundy / BotFrameworkEndpoint.cs
Last active November 19, 2018 23:58
The Bot entry point for an ASP.NET Web Api
[BotAuthentication]
public class MessagesController : ApiController
{
private readonly ITableService _tableService;
public MessagesController(ITableService tableService)
{
_tableService = tableService;
}