feat: support full screen.

This commit is contained in:
rabbitism
2024-03-27 18:29:54 +08:00
parent ac43911000
commit 13e5629b21
7 changed files with 74 additions and 12 deletions

View File

@@ -39,12 +39,17 @@
IsChecked="{Binding CanLightDismiss}"
OffContent="No"
OnContent="Yes" />
<ToggleSwitch
Content="FullScreen"
IsChecked="{Binding FullScreen}"
OffContent="No"
OnContent="Yes" />
<StackPanel Orientation="Horizontal">
<TextBlock Text="Buttons" VerticalAlignment="Center" />
<TextBlock VerticalAlignment="Center" Text="Buttons" />
<u:EnumSelector EnumType="{x:Type u:DialogButton}" Value="{Binding SelectedButton}" />
</StackPanel>
<StackPanel Orientation="Horizontal">
<TextBlock Text="Mode" VerticalAlignment="Center" />
<TextBlock VerticalAlignment="Center" Text="Mode" />
<u:EnumSelector EnumType="{x:Type u:DialogMode}" Value="{Binding SelectedMode}" />
</StackPanel>
<Button Command="{Binding ShowDialogCommand}" Content="Show Dialog" />
@@ -83,6 +88,11 @@
IsChecked="{Binding CanLightDismiss}"
OffContent="No"
OnContent="Yes" />
<ToggleSwitch
Content="FullScreen"
IsChecked="{Binding FullScreen}"
OffContent="No"
OnContent="Yes" />
<Button Command="{Binding ShowCustomDialogCommand}" Content="Show Dialog" />
<TextBlock>
<Run Text="Custom Result: " />

View File

@@ -25,6 +25,7 @@ public partial class DialogDemoViewModel: ObservableObject
[ObservableProperty] private DialogResult? _defaultResult;
[ObservableProperty] private bool _result;
[ObservableProperty] private DateTime? _date;
[ObservableProperty] private bool _fullScreen;
public DialogDemoViewModel()
{
@@ -65,6 +66,7 @@ public partial class DialogDemoViewModel: ObservableObject
HorizontalOffset = 50,
VerticalAnchor = VerticalPosition.Top,
VerticalOffset = 50,
FullScreen = FullScreen,
}
);
Date = vm.Date;
@@ -80,6 +82,7 @@ public partial class DialogDemoViewModel: ObservableObject
Mode = SelectedMode,
Buttons = SelectedButton,
CanLightDismiss = CanLightDismiss,
FullScreen = FullScreen,
});
}
}
@@ -111,6 +114,7 @@ public partial class DialogDemoViewModel: ObservableObject
vm, IsGlobal ? null : "LocalHost", options: new OverlayDialogOptions()
{
CanLightDismiss = CanLightDismiss,
FullScreen = FullScreen,
});
Date = vm.Date;
}
@@ -118,7 +122,7 @@ public partial class DialogDemoViewModel: ObservableObject
{
OverlayDialog.ShowCustom<DialogWithAction, DialogWithActionViewModel>(new DialogWithActionViewModel(),
IsGlobal ? null : "LocalHost",
options: new OverlayDialogOptions{ CanLightDismiss = CanLightDismiss });
options: new OverlayDialogOptions{ CanLightDismiss = CanLightDismiss, FullScreen = FullScreen});
}
}