Reset navigation when Dialog is using IScreen for navigation
MODIFY
WalletWasabi.Fluent/Controls/Dialog.xaml.cs
WalletWasabi.Fluent/Controls/Dialog.xaml.cs
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Primitives;
+using ReactiveUI;
namespace WalletWasabi.Fluent.Controls
{
@@ -51,7 +52,16 @@ namespace WalletWasabi.Fluent.Controls
base.OnApplyTemplate(e);
var overlayButton = e.NameScope.Find<Panel>("PART_Overlay");
- overlayButton.PointerPressed += (_, __) => IsDialogOpen = false;
+ overlayButton.PointerPressed += (_, __) =>
+ {
+ if (DataContext is IScreen screen)
+ {
+ // Reset navigation when Dialog is using IScreen for navigation instead of the default IDialogHost.
+ screen.Router.NavigationStack.Clear();
+ }
+
+ IsDialogOpen = false;
+ };
}
}
}
\ No newline at end of file

Reset navigation when Dialog is using IScreen for navigation