AppNotificationProgressBar.SetTitle(String) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Sets the title text of an app notification progress bar.
public:
virtual AppNotificationProgressBar ^ SetTitle(Platform::String ^ value) = SetTitle;
AppNotificationProgressBar SetTitle(winrt::hstring const& value);
public AppNotificationProgressBar SetTitle(string value);
function setTitle(value)
Public Function SetTitle (value As String) As AppNotificationProgressBar
Parameters
- value
-
String
Platform::String
winrt::hstring
A string containing the title text.
Returns
Returns the AppNotificationProgressBar instance so that additional method calls can be chained.
Examples
The following example illustrates how to set the Title property of an app notification progress bar.
var notification = new AppNotificationBuilder()
.AddText("Downloading your weekly playlist...")
.AddProgressBar(new AppNotificationProgressBar()
.SetTitle("Progress bar title")
.SetValue(.5)
.SetStatus("Downloading...")
.SetValueStringOverride("1/2 files downloaded"))
.BuildNotification();
AppNotificationManager.Default.Show(notification);
The resulting XML payload:
<toast>
<visual>
<binding template='ToastGeneric'>
<text>Downloading your weekly playlist...</text>
<progress title='Progress bar title' status='Downloading...' value='0.5' valueStringOverride='1/2 files downloaded'/>
</binding>
</visual>
</toast>
Remarks
You can also set the title with the AppNotificationProgressBar.Title property.
You can set the title text using data binding by calling AppNotificationProgressBar.BindTitle. Update the bound status value by assigning an AppNotificationProgressData object to the AppNotification.Progresss property.
For guidance on using the AppNotificationBuilder APIs to create the UI for app notifications, see App notification content.
For reference information about the XML schema for app notifications, see App notification content schema.