Add full screen navigation target
MODIFY
WalletWasabi.Fluent.Generators/NavigationMetaDataGenerator.cs
WalletWasabi.Fluent.Generators/NavigationMetaDataGenerator.cs
@@ -28,7 +28,8 @@ namespace WalletWasabi.Fluent
Default = 0,
HomeScreen = 1,
DialogScreen = 2,
- DialogHost = 3
+ FullScreen = 3,
+ DialogHost = 4
}
public sealed class NavigationMetaData

MODIFY
WalletWasabi.Fluent/Controls/Dialog.xaml
WalletWasabi.Fluent/Controls/Dialog.xaml
<Panel Background="{DynamicResource DialogOverlayColor}" Name="PART_Overlay" VerticalAlignment="Stretch" HorizontalAlignment="Stretch" />
<Panel Name="PART_DialogHost"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
- HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
- Margin="20">
- <Border CornerRadius="4" BoxShadow="{DynamicResource DialogBoxShadow}"
+ HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
+ <Border Name="PART_Border"
Background="{DynamicResource RegionColor}"
- MaxWidth="{TemplateBinding MaxContentWidth}" MaxHeight="{TemplateBinding MaxContentHeight}" Margin="40">
+ MaxWidth="{TemplateBinding MaxContentWidth}" MaxHeight="{TemplateBinding MaxContentHeight}">
<ContentPresenter Name="PART_ContentPresenter" Margin="16 28 16 16"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
<Setter Property="Opacity" Value="0"/>
</Style>
<Style Selector="c|Dialog /template/ Panel#PART_DialogHost">
+ <Setter Property="Margin" Value="20"/>
<Setter Property="Transitions">
<Transitions>
<TransformOperationsTransition Property="RenderTransform" Duration="0:0:0.35" Easing="{StaticResource FluentEasing}" />
</Setter>
<Setter Property="Opacity" Value="0"/>
</Style>
+ <Style Selector="c|Dialog /template/ Border#PART_Border">
+ <Setter Property="Margin" Value="40"/>
+ <Setter Property="CornerRadius" Value="4"/>
+ <Setter Property="BoxShadow" Value="{DynamicResource DialogBoxShadow}"/>
+ </Style>
<!-- Dialog Opened State -->
<Style Selector="c|Dialog:open /template/ Panel#PART_DialogHost">

MODIFY
WalletWasabi.Fluent/ViewModels/AddWallet/AddWalletPageViewModel.cs
WalletWasabi.Fluent/ViewModels/AddWallet/AddWalletPageViewModel.cs
@@ -29,6 +29,7 @@ namespace WalletWasabi.Fluent.ViewModels.AddWallet
Category = "General",
Keywords = new[] { "Wallet", "Add", "Create", "Recover", "Import", "Connect", "Hardware", "ColdCard", "Trezor", "Ledger" },
IconName = "add_circle_regular",
+ NavigationTarget = NavigationTarget.FullScreen,
NavBarPosition = NavBarPosition.Bottom)]
public partial class AddWalletPageViewModel : NavBarItemViewModel
{

MODIFY
WalletWasabi.Fluent/ViewModels/Dialogs/DialogScreenViewModel.cs
WalletWasabi.Fluent/ViewModels/Dialogs/DialogScreenViewModel.cs
@@ -10,9 +10,14 @@ namespace WalletWasabi.Fluent.ViewModels.Dialogs
public partial class DialogScreenViewModel : TargettedNavigationStack
{
[AutoNotify] private bool _isDialogOpen;
+ [AutoNotify] private double _maxContentWidth;
+ [AutoNotify] private double _maxContentHeight;
- public DialogScreenViewModel() : base(NavigationTarget.DialogScreen)
+ public DialogScreenViewModel(double maxContentWidth, double maxContentHeight, NavigationTarget navigationTarget = NavigationTarget.DialogScreen) : base(navigationTarget)
{
+ _maxContentWidth = maxContentWidth;
+ _maxContentHeight = maxContentHeight;
+
this.WhenAnyValue(x => x.IsDialogOpen)
.Skip(1) // Skip the initial value change (which is false).
.DistinctUntilChanged()

MODIFY
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
WalletWasabi.Fluent/ViewModels/MainViewModel.cs
@@ -24,8 +24,10 @@ namespace WalletWasabi.Fluent.ViewModels
private readonly Global _global;
[AutoNotify] private bool _isMainContentEnabled;
[AutoNotify] private bool _isDialogScreenEnabled;
+ [AutoNotify] private bool _isFullScreenEnabled;
[AutoNotify] private DialogViewModelBase? _currentDialog;
[AutoNotify] private DialogScreenViewModel _dialogScreen;
+ [AutoNotify] private DialogScreenViewModel _fullScreen;
[AutoNotify] private NavBarViewModel _navBar;
[AutoNotify] private StatusBarViewModel _statusBar;
[AutoNotify] private string _title = "Wasabi Wallet";
@@ -39,11 +41,13 @@ namespace WalletWasabi.Fluent.ViewModels
{
_global = global;
- _dialogScreen = new DialogScreenViewModel();
+ _dialogScreen = new DialogScreenViewModel(800, 700);
+
+ _fullScreen = new DialogScreenViewModel(double.PositiveInfinity, double.PositiveInfinity, NavigationTarget.FullScreen);
MainScreen = new TargettedNavigationStack(NavigationTarget.HomeScreen);
- NavigationState.Register(MainScreen, DialogScreen, () => this);
+ NavigationState.Register(MainScreen, DialogScreen, FullScreen, () => this);
Network = global.Network;
@@ -51,6 +55,7 @@ namespace WalletWasabi.Fluent.ViewModels
_isMainContentEnabled = true;
_isDialogScreenEnabled = true;
+ _isFullScreenEnabled = true;
_statusBar = new StatusBarViewModel(
global.DataDir,
@@ -88,9 +93,17 @@ namespace WalletWasabi.Fluent.ViewModels
.ObserveOn(RxApp.MainThreadScheduler)
.Subscribe(x => IsMainContentEnabled = !x);
+ this.WhenAnyValue(x => x.FullScreen!.IsDialogOpen)
+ .ObserveOn(RxApp.MainThreadScheduler)
+ .Subscribe(x => IsMainContentEnabled = !x);
+
this.WhenAnyValue(x => x.CurrentDialog!.IsDialogOpen)
.ObserveOn(RxApp.MainThreadScheduler)
- .Subscribe(x => IsDialogScreenEnabled = !x);
+ .Subscribe(x =>
+ {
+ IsFullScreenEnabled = !x;
+ IsDialogScreenEnabled = !x;
+ });
_walletManager.WhenAnyValue(x => x.Items.Count)
.Subscribe(x => _navBar.IsHidden = x == 0);

MODIFY
WalletWasabi.Fluent/ViewModels/Navigation/NavigationState.cs
WalletWasabi.Fluent/ViewModels/Navigation/NavigationState.cs
@@ -5,10 +5,15 @@ namespace WalletWasabi.Fluent.ViewModels.Navigation
{
public class NavigationState
{
- private NavigationState(INavigationStack<RoutableViewModel> homeScreenNavigation, INavigationStack<RoutableViewModel> dialogScreenNavigation, Func<IDialogHost> dialogHost)
+ private NavigationState(
+ INavigationStack<RoutableViewModel> homeScreenNavigation,
+ INavigationStack<RoutableViewModel> dialogScreenNavigation,
+ INavigationStack<RoutableViewModel> fullScreenNavigation,
+ Func<IDialogHost> dialogHost)
{
HomeScreenNavigation = homeScreenNavigation;
DialogScreenNavigation = dialogScreenNavigation;
+ FullScreenNavigation = fullScreenNavigation;
DialogHost = dialogHost;
}
@@ -20,9 +25,19 @@ namespace WalletWasabi.Fluent.ViewModels.Navigation
public INavigationStack<RoutableViewModel> DialogScreenNavigation { get; }
- public static void Register(INavigationStack<RoutableViewModel> homeScreenNavigation, INavigationStack<RoutableViewModel> dialogScreenNavigation, Func<IDialogHost> dialogHost)
+ public INavigationStack<RoutableViewModel> FullScreenNavigation { get; }
+
+ public static void Register(
+ INavigationStack<RoutableViewModel> homeScreenNavigation,
+ INavigationStack<RoutableViewModel> dialogScreenNavigation,
+ INavigationStack<RoutableViewModel> fullScreenNavigation,
+ Func<IDialogHost> dialogHost)
{
- Instance = new NavigationState(homeScreenNavigation, dialogScreenNavigation, dialogHost);
+ Instance = new NavigationState(
+ homeScreenNavigation,
+ dialogScreenNavigation,
+ fullScreenNavigation,
+ dialogHost);
}
}
}
\ No newline at end of file

MODIFY
WalletWasabi.Fluent/ViewModels/Navigation/RoutableViewModel.cs
WalletWasabi.Fluent/ViewModels/Navigation/RoutableViewModel.cs
@@ -74,6 +74,9 @@ namespace WalletWasabi.Fluent.ViewModels.Navigation
case NavigationTarget.DialogScreen:
return NavigationState.Instance.DialogScreenNavigation;
+
+ case NavigationTarget.FullScreen:
+ return NavigationState.Instance.FullScreenNavigation;
}
throw new NotSupportedException();

MODIFY
WalletWasabi.Fluent/Views/MainView.axaml
WalletWasabi.Fluent/Views/MainView.axaml
EnableCancelOnEscape="True"
IsEnabled="{Binding $parent.DataContext.IsDialogScreenEnabled}"
HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
- MaxContentWidth="800" MaxContentHeight="700">
+ MaxContentWidth="{Binding MaxContentWidth}" MaxContentHeight="{Binding MaxContentHeight}">
+ <ContentControl Content="{Binding CurrentPage}" />
+ </c:Dialog>
+ <c:Dialog x:CompileBindings="False"
+ DataContext="{Binding FullScreen}"
+ IsDialogOpen="{Binding IsDialogOpen, Mode=TwoWay}"
+ EnableCancelOnPressed="False"
+ EnableCancelOnEscape="True"
+ IsEnabled="{Binding $parent.DataContext.IsFullScreenEnabled}"
+ HorizontalAlignment="Stretch" VerticalAlignment="Stretch"
+ MaxContentWidth="{Binding MaxContentWidth}" MaxContentHeight="{Binding MaxContentHeight}">
+ <c:Dialog.Styles>
+ <Style Selector="c|Dialog /template/ Panel#PART_DialogHost">
+ <Setter Property="Margin" Value="0"/>
+ </Style>
+ <Style Selector="c|Dialog /template/ Border#PART_Border">
+ <Setter Property="Margin" Value="0"/>
+ <Setter Property="CornerRadius" Value="0"/>
+ </Style>
+ </c:Dialog.Styles>
<ContentControl Content="{Binding CurrentPage}" />
</c:Dialog>
<c:Dialog DataContext="{Binding CurrentDialog}"

Add full screen navigation target