diff --git a/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/NumericValidationBehaviorPage.xaml.cs b/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/NumericValidationBehaviorPage.xaml.cs index 62dd5603a8..03aa561cde 100644 --- a/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/NumericValidationBehaviorPage.xaml.cs +++ b/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/NumericValidationBehaviorPage.xaml.cs @@ -1,4 +1,5 @@ using CommunityToolkit.Maui.Alerts; +using CommunityToolkit.Maui.Behaviors; using CommunityToolkit.Maui.Sample.ViewModels.Behaviors; namespace CommunityToolkit.Maui.Sample.Pages.Behaviors; @@ -11,14 +12,15 @@ public NumericValidationBehaviorPage(NumericValidationBehaviorViewModel numericV InitializeComponent(); } -#if !DEBUG - void SetEntryValue(object? sender, EventArgs e) - { -#else async void SetEntryValue(object? sender, EventArgs e) { - await Toast.Make($"The app will crash because {nameof(Options.SetShouldSuppressExceptionsInBehaviors)} is false", Core.ToastDuration.Long).Show(); -#endif + var toastVisibilityTimeSpan = TimeSpan.FromSeconds(5); + var cts = new CancellationTokenSource(toastVisibilityTimeSpan); + + await Toast.Make($"The app will crash because `null` is an invalid value for {nameof(NumericValidationBehavior)}.\nOptionally, {nameof(Options)}.{nameof(Options.SetShouldSuppressExceptionsInBehaviors)} can be set to true", Core.ToastDuration.Long).Show(cts.Token); + + await Task.Delay(toastVisibilityTimeSpan, cts.Token); + SafeEntry.Text = null; } } \ No newline at end of file diff --git a/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/SelectAllTextBehaviorPage.xaml b/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/SelectAllTextBehaviorPage.xaml index 28aa52abcd..c1d8e00a96 100644 --- a/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/SelectAllTextBehaviorPage.xaml +++ b/samples/CommunityToolkit.Maui.Sample/Pages/Behaviors/SelectAllTextBehaviorPage.xaml @@ -19,13 +19,8 @@