Using a timer in a Windows Store application
This recipe shows how to use a simple timer in Windows Store applications.
Getting ready
To step through this recipe, you will need Visual Studio 2012 and the Windows 8+ operating system. No other prerequisites are required. The source code for this recipe can be found at 7644_Code\Chapter11\Recipe1
.
How to do it...
To understand how to use a timer in a Windows Store application, perform the following steps:
- Start Visual Studio 2012. Create a new C# Blank App (XAML) project under Windows Store.
- In case you are asked to renew your developer license, you have to agree to the Microsoft privacy terms.
- Then, sign in to your Microsoft account (or create one first).
- Finally, you get a confirmation dialog that the developer license was successfully renewed.
- In the
MainPage.xaml
file, add theName
attribute to theGrid
element:<Grid Name="Grid" Background="{StaticResourceApplicationPageBackgroundThemeBrush}">
- In the
MainPage.xaml.cs
file...