Pop-up Notification dialog box
1 < Grid > 2 < 3 Content= "pop-up Notification"4 click= "button _click "/>5 </Grid>
1 Private Async voidButton_Click (Objectsender, RoutedEventArgs e)2 {3 ////Create a dialog box object4 //Messagedialog Dialog = new Messagedialog ("toast Notice");5 ////Show dialog box6 //await dialog. Showasync ();7 //less, just like you don't use alert in a webpage8 await NewMessagedialog ("Popup dialog box"). Showasync ();9}
Toast Notice
1 < Grid > 2 < 3 Content= "Toast Notification"4 click= "Button_ Click_1 "/>5 </Grid>
1 Private Async voidButton_click_1 (Objectsender, RoutedEventArgs e)2 {3 //Get basic Toast Templates4 varToasttmpl =toastnotificationmanager.gettemplatecontent (toasttemplatetype.toasttext01);5 //Fill Template Placeholder6 varTextnode = Toasttmpl.getelementsbytagname ("text"). FirstOrDefault ();7 if(Textnode = =NULL)8 {9 await NewWindows.UI.Popups.MessageDialog ("shit"). Showasync ();Ten return; One } A //Set innertext -Textnode.innertext ="Hello"; - //Create a Toast notification object the varToastnotification =Newtoastnotification (Toasttmpl); - //Show toast Notifications - //Show toast notification requires a display object - Toastnotificationmanager.createtoastnotifier (). Show (toastnotification); +}
Windows Phone 13, notification hubs