WinRT知识积累2之MessageDialog应用代码

 private void NavigationHelper_SaveState(object sender, SaveStateEventArgs e)
{
// TODO: 在此处保存页面的唯一状态。
ApplicationDataContainer localsetting = Windows.Storage.ApplicationData.Current.LocalSettings;
if ((String)localsetting.Values["AppCourt"] == "")
{
localsetting.Values["AppCourt"] = "";
showMessageBox();
}
else if (localsetting.Values.ContainsKey("AppCourt"))
{
localsetting.Values["AppCourt"] =(int.Parse((String)localsetting.Values["AppCourt"])+).ToString();
}
else
{
localsetting.Values["AppCourt"] = "";
}
}
async void showMessageBox()
{
MessageDialog messagedialog = new MessageDialog("给个好评鼓励开发=_=");
messagedialog.Commands.Add(new UICommand("好评",new UICommandInvokedHandler(this.CommandRateInvokedHandler)));
messagedialog.Commands.Add(new UICommand("取消"));
await messagedialog.ShowAsync();
}
上一篇:Win10 UWP开发系列:开发一个自定义控件——带数字徽章的AppBarButton


下一篇:asp.net webform 自定义分页控件