File tree Expand file tree Collapse file tree 1 file changed +10
-2
lines changed
Microsoft.Toolkit.Uwp.SampleApp/SamplePages/InAppNotification Expand file tree Collapse file tree 1 file changed +10
-2
lines changed Original file line number Diff line number Diff line change @@ -46,21 +46,29 @@ if (isTemplatePresent && inAppNotificationWithButtonsTemplate is DataTemplate)
46
46
ExampleInAppNotification.Show(inAppNotificationWithButtonsTemplate as DataTemplate);
47
47
}
48
48
49
+ // Show notification using an object
50
+ <controls:InAppNotification
51
+ x:Name="ExampleInAppNotification"
52
+ ContentTemplate="{StaticResource MyNotificationDataTemplate}" />
53
+
54
+ var notificationData = new MyNotificationData("Title", "Message");
55
+ ExampleInAppNotification.Show(notificationData, duration: 2000);
56
+
49
57
// Dismiss notification
50
58
ExampleInAppNotification.Dismiss();
51
59
52
60
// ## C# - Handle button events
53
61
54
62
private void YesButton_Click(object sender, RoutedEventArgs e)
55
63
{
56
- // TODO : Do something when user accepted
64
+ // TODO : Do something when user accepted
57
65
58
66
ExampleInAppNotification.Dismiss();
59
67
}
60
68
61
69
private void NoButton_Click(object sender, RoutedEventArgs e)
62
70
{
63
- // TODO : Do something when user refused
71
+ // TODO : Do something when user refused
64
72
65
73
ExampleInAppNotification.Dismiss();
66
74
}
You can’t perform that action at this time.
0 commit comments