Skip to content

Instantly share code, notes, and snippets.

View mrlacey's full-sized avatar
😇

Matt Lacey mrlacey

😇
View GitHub Profile
@mrlacey
mrlacey / gist:7779351
Created December 3, 2013 23:08
Alphabetic JumpList contact names
<phone:LongListSelector
ItemsSource="{Binding}"
IsGroupingEnabled="True"
HideEmptyGroups="True"
LayoutMode="List"
toolkit:TiltEffect.IsTiltEnabled="True">
<phone:LongListSelector.ItemTemplate>
<DataTemplate>
<Grid>
<StackPanel Orientation="Horizontal" VerticalAlignment="Center">
@mrlacey
mrlacey / AlternateRows.cs
Last active January 3, 2016 22:38
CodeBehind for Alternate row highlighting demo
namespace AlternateRows
{
using System;
using System.Collections.ObjectModel;
using System.Windows.Data;
using System.Windows.Media;
using Microsoft.Phone.Controls;
public partial class MainPage : PhoneApplicationPage
@mrlacey
mrlacey / AlternateRows.xaml
Created January 20, 2014 21:25
XAML for Alternate row highlighting demo
<phone:PhoneApplicationPage
x:Class="AlternateRows.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:alternateRows="clr-namespace:AlternateRows"
FontFamily="{StaticResource PhoneFontFamilyNormal}"
Foreground="{StaticResource PhoneForegroundBrush}"
SupportedOrientations="Portrait"
@mrlacey
mrlacey / DebugBuildOnly.cs
Created November 8, 2016 03:35
For creating XAML based solution for limiting which build controls are included in
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace OnlyIn
{
public class DebugBuild : ContentControl
{
protected override void OnApplyTemplate()
{
base.OnApplyTemplate();
<Page
x:Class="MediaDial.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">
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<StackPanel Padding="50">
using Windows.UI.Xaml.Controls;
namespace OnlyIn
{
public class DebugBuild : ContentControl
{
protected override void OnApplyTemplate()
{
base.OnApplyTemplate();
@mrlacey
mrlacey / IsOneOfBenchmarks.cs
Last active October 10, 2017 06:14
Benchmark tests comparing ways of matching a variable against multiple possible options. As created for http://www.mrlacey.com/2017/10/optimizing-comparison-of-variable-with.html
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using System.Linq;
namespace IsOneOfBenchmarks
{
class Program
{
static void Main(string[] args)
{
@mrlacey
mrlacey / AutomatedWizardTestingBase.cs
Last active April 24, 2018 19:23
Base class for WinAppDriver based UI tests
public class AutomatedWizardTestingBase : IDisposable
{
protected WindowsDriver<WindowsElement> AppSession { get; private set; }
protected AutomatedWizardTestingBase()
{
CheckWinAppDriverInstalled();
StartWinAppDriverIfNotRunning();
}
@mrlacey
mrlacey / StrRevVizBenchamarks.cs
Created November 12, 2018 21:05
Code used in benchmark tests for StringResourceVisualizer when reviewing cahnging string manipulation to use Span<T>
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
@mrlacey
mrlacey / GridLines.cs
Created December 8, 2018 16:19
UWP Grid ShowGridLines
public class GridLines : DependencyObject
{
public static readonly DependencyProperty AreVisibleProperty =
DependencyProperty.RegisterAttached(
"AreVisible",
typeof(Boolean),
typeof(GridLines),
new PropertyMetadata(false, OnPropertyChanged)
);