Previously, in Silverlight Runtime, to set a minimized toolbar, you would simply set the 'Mode' property of the 'ApplicationBar' to 'Minimized'. This no longer works for Windows Phone Runtime 8.1. Tt appears minimized in the XAML designer, but it will still be expanded when running. Let's see how to fix it. …
Recently I am rewriting an old App using WinRT, I need to display a clock, but I find there is no Timer control.
It looks like I have to implement the Timer myself. I don't use Thread.Sleep because it will block UI thread. I prefer using async await over it. To replace Thread.Sleep, I use Task.Delay:
while (true)
{
// 要做的操作
await Task.Delay(毫秒);
}
为了增加逼格和可重用性,我们需要进一步封装。注意观察本高(