AppNotificationProgressBar.SetValueStringOverride(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 value string override of an app notification progress bar.
public:
virtual AppNotificationProgressBar ^ SetValueStringOverride(Platform::String ^ value) = SetValueStringOverride;
AppNotificationProgressBar SetValueStringOverride(winrt::hstring const& value);
public AppNotificationProgressBar SetValueStringOverride(string value);
function setValueStringOverride(value)
Public Function SetValueStringOverride (value As String) As AppNotificationProgressBar
Parameters
- value
-
String
Platform::String
winrt::hstring
A string containing the value string override text.
Returns
Returns the AppNotificationProgressBar instance so that additional method calls can be chained.
Examples
The following example illustrates how to set the ValueStringOverride 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 value string override text with the AppNotificationProgressBar.ValueStringOverride property.
You can set the title text using data binding by calling AppNotificationProgressBar.BindValueStringOverride. 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.