Reusable code snippets for the Universal Windows Platform.
Перейти к файлу
microsoft-github-policy-service[bot] 4a5b507865
Auto merge mandatory file pr
This pr is auto merged as it contains a mandatory file and is opened for more than 10 days.
2022-11-28 19:13:42 +00:00
tasks Add task cancellation snippet 2020-10-10 14:57:44 -07:00
CONTRIBUTING.md added code of conduct info 2016-08-17 15:35:26 -07:00
LICENSE initial commit 2016-02-16 11:19:43 -08:00
README.md Add task cancellation snippet 2020-10-10 14:57:44 -07:00
SECURITY.md Microsoft mandatory file 2022-09-01 18:07:14 +00:00

README.md

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.

Snippets

Data binding

Data binding change notification
Data-bind an InkCanvas control

Files and folders

File exists
Preserve access to a folder
Launch executable

Colors

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

Images

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

Media

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
Thread switching within a task

Tasks

Cancelling a task after a delay

Sockets

Socket programming with TCP
Socket programming with UDP

Popups

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

Miscellaneous

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