Add local var
MODIFY
WalletWasabi.Fluent/ViewModels/RoutableViewModel.cs
WalletWasabi.Fluent/ViewModels/RoutableViewModel.cs
@@ -95,34 +95,48 @@ namespace WalletWasabi.Fluent.ViewModels
public void GoBack(NavigationTarget navigationTarget)
{
+ var router = default(RoutingState);
+
switch (navigationTarget)
{
case NavigationTarget.Default:
case NavigationTarget.HomeScreen:
- NavigationState.HomeScreen.Invoke().Router.NavigateBack.Execute();
+ router = NavigationState.HomeScreen.Invoke().Router;
break;
case NavigationTarget.DialogScreen:
- NavigationState.DialogScreen.Invoke().Router.NavigateBack.Execute();
+ router = NavigationState.DialogScreen.Invoke().Router;
break;
}
+
+ if (router is not null)
+ {
+ router.NavigateBack.Execute();
+ }
}
public void GoBack() => GoBack(NavigationTarget);
public void ClearNavigation(NavigationTarget navigationTarget)
{
+ var router = default(RoutingState);
+
switch (navigationTarget)
{
case NavigationTarget.Default:
case NavigationTarget.HomeScreen:
- NavigationState.HomeScreen.Invoke().Router.NavigationStack.Clear();
+ router = NavigationState.HomeScreen.Invoke().Router;
break;
case NavigationTarget.DialogScreen:
- NavigationState.DialogScreen.Invoke().Router.NavigationStack.Clear();
+ router = NavigationState.DialogScreen.Invoke().Router;
break;
}
+
+ if (router is not null)
+ {
+ router.NavigationStack.Clear();
+ }
}
public void ClearNavigation() => ClearNavigation(NavigationTarget);

Add local var