🎄 Merry Christmas! 🎅

Edi Wang

Microsoft MVP for Azure

Posts in 11月 2015

Windows 10 UWP开发:如何定时触发后台任务

今天在爆UWP的定时后台任务,坑有点多。有的坑在很多网上的文章里都没提到,非常的坑。刚刚开荒成功了,把经验写出来分享: 1. 写一个后台任务的类,继承IBackgroundTask接口 通常,在设计应用程序结构的时候,我们会建类库项目(Class Library)放这些类。比如 FarkBackgroundTask.Core 因为是UWP工程,所以建的类库也要是Universal Windows的。注意,这里我们已经埋下了一个巨坑,稍后会解释。 我们的类代码如下: public class SayFarkTask : IBackgroundTask { public void Run(IBackgroundTaskInstance taskInstance) { Debug.Write("================ Fark the
Windows Timer UWP Task

Windows 10 UWP开发:如何弹出消息通知

在UWP的App中,弹出消息通知的方法和WinRT一致,注意是App内的消息通知(toast notification)而不是从服务器端推送的通知。主要有几个步骤: 1. 创建XML定义 // 1. create element ToastTemplateType toastTemplate = ToastTemplateType.ToastImageAndText01; XmlDocument toastXml = ToastNotificationManager.GetTemplateContent(toastTemplate); 这里面的消息模板有好几种: // // Summary: // 指定要在消息通知中使用的模版。 [ContractVersion(typeof(UniversalApiContract), 65536)] public enum …
Windows UWP

Windows 10 UWP Development: How to Implement WP8's Pivot Effect

The animation effect of the Pivot widget in UWP is different from the previous Pivot in Windows 8 and Windows Phone 8, when switching PivotItem, the header of the currently selected Item will not run to the first one, but simply highlight the current Tab like a Tab tab. Personally, I like Windows 8's Pivot, which is like this GIF (which is a UWP app I'm working on). If you also like the traditional style of Pivot, you can refer to the following methods.
Windows UWP