This recipe shows you how to use a simple timer in Universal Windows Platform applications.
To go through this recipe, you will need Visual Studio 2015 and the Windows 10 operating system. No other prerequisites are required. The source code for this recipe can be found at BookSamples\Chapter11\Recipe1
.
To understand how to use a timer in a Windows Store application, perform the following steps:
Start Visual Studio 2015. Create a new C# Blank App (Universal Windows) project in the
Windows\Universal
folder.If you are asked to enable developer mode for Windows 10, you have to enable it in the control panel.
Then, confirm that you are sure you want to turn on developer mode.
In the
MainPage.xaml
file, add theName
attribute to theGrid
element:<Grid Name="Grid" Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
In the
MainPage.xaml.cs
file, add the followingusing
directives:using System;...