Windows Phone 8.1 Tiles, Notifications and Action Center
2020-12-13 02:23
标签:c style class blog code java (1)Tiles Tiles 也就是磁贴,是 Windows Phone 的一大特色。 一个 Tile 其实可以看成是一个 XML,比如: 微软为我们提供了一系列模板,具体可参照:链接 只要根据模板的 XML 格式,便可轻松的更新 Tile: 除了主磁贴外我们还可以新建 SecondaryTile: SecondaryTile 的更新与主磁贴更新一样: (2)Notifications Notification(推送通知)分为 Tile,Badge,Toast,Raw
四种类型,而通知的方式又分为 Scheduled,Periodic,Local,Push 四种,它们之间对应的关系为: 使用方法都大同小异,根据各自的 XML 格式修改再调用 Update 方法即可,例如: 需要注意的是:(1)Toast 通知需要在 Manifest 中许可;(2)Push
方法为: (3)Action Center 1)每个应用最多可以在 Action Center 中驻留 20 条通知 2)通知最多可驻留 7 天 3)可发送静默通知(不会提示用户) 4)可对通知进行分组 5)可更新或删除通知(可删除某一组) Windows Phone 8.1 Tiles, Notifications and Action
Center,搜素材,soscw.com Windows Phone 8.1 Tiles, Notifications and Action
Center 标签:c style class blog code java 原文地址:http://www.cnblogs.com/xiaoshi3003/p/3764507.htmltile>
visual>
binding template="TileSquareImage">
image id="1" src="image1" alt="alt text"/>
binding>
visual>
tile>
tile>
visual version="2">
binding template="TileSquare150x150Image" fallback="TileSquareImage">
image id="1" src="image1" alt="alt text"/>
binding>
visual>
tile>
private void updateButton_Click(object sender, RoutedEventArgs e)
{
UpdateTiles("ms-appx:///Images/Middle.png", "ms-appx:///Images/Wide.png");
}
private void UpdateTiles(string middlePath, string widePath)
{
string tileString = "
private void createButton_Click(object sender, RoutedEventArgs e)
{
CreateTile("ms-appx:///Images/Middle.png", "ms-appx:///Images/Wide.png");
}
private async void CreateTile(string middlePath, string widePath)
{
SecondaryTile tile = new SecondaryTile("Cortana", "Cortana", "Some", new Uri(middlePath), TileSize.Default);
tile.VisualElements.ShowNameOnSquare150x150Logo = true;
tile.VisualElements.ForegroundText = ForegroundText.Dark;
tile.VisualElements.Square30x30Logo = new Uri(middlePath);
tile.VisualElements.Wide310x150Logo = new Uri(widePath);
await tile.RequestCreateAsync();
}
TileUpdater update = TileUpdateManager.CreateTileUpdaterForSecondaryTile("Cortana");
XmlDocument xml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText04);
ToastNotification toast = new ToastNotification(xml);
ToastNotifier notifier = ToastNotificationManager.CreateToastNotifier();
notifier.Show(toast);
private async void SendRawNotification()
{
var channel = await PushNotificationChannelManager.CreatePushNotificationChannelForApplicationAsync();
channel.PushNotificationReceived += channel_PushNotificationReceived;
}
private void channel_PushNotificationReceived(PushNotificationChannel sender, PushNotificationReceivedEventArgs args)
{
var raw = args.RawNotification;
}
toast1.SuppressPopup = true;
XmlDocument xml = ToastNotificationManager.GetTemplateContent(ToastTemplateType.ToastText04);
ToastNotification toast1 = new ToastNotification(xml);
toast1.Group = "One";
toast1.Tag = "1";
ToastNotificationManager.History.RemoveGroup("One");
上一篇:php中上传图片
下一篇:js 正则学习小记之匹配字符串
文章标题:Windows Phone 8.1 Tiles, Notifications and Action Center
文章链接:http://soscw.com/essay/25488.html