Universal Windows Platform – Tutorial Insider – Toast Styles

Standard

comentsys.wordpress.com today features a Universal Windows Platform tutorial showing how to use Toast Styles, these are the different types of toast notifications that are possible.

Details

There’s a GetTemplates method to get the ToastTemplateType then returns those as an IEnumerable of string. UpdateToast takes a string “style” and “value” – the former is used to get the correct ToastTemplateType based on the style passed in, the latter is used to create a node for the template to represent the value used on the Toast, a ToastNotification is created from this and passed to the Update method of the ToastNotificationManager with CreateToastNotifier. The Dialog has a ComboBox set to the templates using GetTemplates and has a TextBox to enter the value to show – the selected template and value is returned as a Tuple which here is a pair of string values for each of those selections.

The Toast method uses the Dialog method to get the Tuple that contains the selected template and value to use and this is passed to the UpdateToast method from the “result” of the Dialog.

Behind the Scenes

Toast Styles shows how you can use the built-in templates for creating toast notifications in different ways, there are more options in some of the templates to product more complex layouts and this example is just the start of showing how flexable toast notifications can be and how easy it is to update them, makes a great feature of an application that needs to show something with a toast in a variety of different ways.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s