Reusable code snippets for the Universal Windows Platform.
Switch branches/tags
Nothing to show
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
tasks added color names snippet Apr 4, 2017 added code of conduct info Aug 17, 2016
LICENSE initial commit Feb 16, 2016 added color names snippet Apr 4, 2017

Windows task snippets

This repo collects snippets of ready-to-use code that accomplish small but useful tasks of interest to Universal Windows Platform (UWP) app developers. These snippets represent simple solutions to common problems, and simple recipes to help you implement new app features.

Each snippet includes the using statements that it requires, which you can add to the top of your file as needed.

Each snippet is written in C# unless otherwise indicated.

For more UWP samples, see Windows on GitHub.


Data binding

Data binding change notification
Data-bind an InkCanvas control

Files and folders

File exists
Preserve access to a folder
Launch executable


Color names and contrasting foregrounds
Colors as a collection
Convert hex to color
Convert RGB to HSV


Bing image-of-the-day URI
Capture an image


Concatenate media files
Play sound once or looped

UI thread

UI thread access from background thread
UI thread task await from background thread
UI update after a delay
UI updates with a timer


Socket programming with TCP
Socket programming with UDP


Show pop-up asking user to rate app
Show dialog box


App version and title
Clipboard text
Get user info
Convert the DPI of rectangles (C++)
Get a device's current location
Time-specific salutation