Skip to content

Instantly share code, notes, and snippets.

Matt Lacey mrlacey

View GitHub Profile
mrlacey / GridLines.cs
Created Dec 8, 2018
UWP Grid ShowGridLines
View GridLines.cs
public class GridLines : DependencyObject
public static readonly DependencyProperty AreVisibleProperty =
new PropertyMetadata(false, OnPropertyChanged)
mrlacey / StrRevVizBenchamarks.cs
Created Nov 12, 2018
Code used in benchmark tests for StringResourceVisualizer when reviewing cahnging string manipulation to use Span<T>
View StrRevVizBenchamarks.cs
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 / AutomatedWizardTestingBase.cs
Last active Apr 24, 2018
Base class for WinAppDriver based UI tests
View AutomatedWizardTestingBase.cs
public class AutomatedWizardTestingBase : IDisposable
protected WindowsDriver<WindowsElement> AppSession { get; private set; }
protected AutomatedWizardTestingBase()
mrlacey / IsOneOfBenchmarks.cs
Last active Oct 10, 2017
Benchmark tests comparing ways of matching a variable against multiple possible options. As created for
View IsOneOfBenchmarks.cs
using BenchmarkDotNet.Attributes;
using BenchmarkDotNet.Running;
using System.Linq;
namespace IsOneOfBenchmarks
class Program
static void Main(string[] args)
View MediaDial.xaml
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<StackPanel Padding="50">
View ImprovedOnlyDebugBuild.cs
using Windows.UI.Xaml.Controls;
namespace OnlyIn
public class DebugBuild : ContentControl
protected override void OnApplyTemplate()
mrlacey / DebugBuildOnly.cs
Created Nov 8, 2016
For creating XAML based solution for limiting which build controls are included in
View DebugBuildOnly.cs
using Windows.UI.Xaml;
using Windows.UI.Xaml.Controls;
namespace OnlyIn
public class DebugBuild : ContentControl
protected override void OnApplyTemplate()
mrlacey / AdMediatorSizeByDevice.xaml
Last active Oct 12, 2015
Example of how to change the size of the AdMediatorControl depending on the device width.
View AdMediatorSizeByDevice.xaml
<Universal:AdMediatorControl x:Name="AdControl"
Width="728" />
<VisualStateGroup x:Name="VisualStateGroup">
<VisualState x:Name="Mobile">
mrlacey / MultiColorImageCreator
Created Jun 12, 2015
Snippet from a WPF app that produces an image where every pixel is a different color.
View MultiColorImageCreator
using System.Drawing;
using System.Drawing.Imaging;
using System.Windows;
namespace GenerateMultiColorImages
public partial class MainWindow : Window
public MainWindow()
mrlacey / addAppointment
Created Mar 9, 2015
Things you can do with Windows 10 Web Apps
View addAppointment
addAppointment = function(e, t, n) {
if ("undefined" != typeof Windows) {
var o = new Windows.ApplicationModel.Appointments.Appointment;
o.allDay = !0, o.startTime = new Date(i(t, "dddd, Do MMM YYYY").format()), o.subject = "Trip to " + n, Windows.ApplicationModel.Appointments.AppointmentManager.showAddAppointmentAsync(o, {
x: 300,
y: 0,
width: 600,
height: 100
}).done(function(t) {
t ? (console.log("created!"), e()) : console.log("issue")
You can’t perform that action at this time.