feat: Update demo. improve resizer margin for drawer.

This commit is contained in:
rabbitism
2024-09-17 23:13:56 +08:00
parent 219ead2172
commit dcba26e8af
5 changed files with 23 additions and 0 deletions

View File

@@ -50,6 +50,7 @@
IsChecked="{Binding IsCloseButtonVisible}"
IsThreeState="True" />
<CheckBox u:FormItem.Label="CanDragMove" IsChecked="{Binding CanDragMove}" />
<CheckBox u:FormItem.Label="CanResize" IsChecked="{Binding CanResize}" />
<Button
HorizontalAlignment="Left"
u:FormItem.NoLabel="True"
@@ -85,6 +86,7 @@
IsThreeState="True" />
<CheckBox u:FormItem.Label="Modal" IsChecked="{Binding IsModal}" />
<CheckBox u:FormItem.Label="CanDragMove" IsChecked="{Binding CanDragMove}" />
<CheckBox u:FormItem.Label="CanResize" IsChecked="{Binding CanResize}" />
<Button
HorizontalAlignment="Left"
u:FormItem.NoLabel="True"
@@ -120,6 +122,7 @@
<CheckBox u:FormItem.Label="Can DragMove" IsChecked="{Binding CanDragMove}" />
<CheckBox u:FormItem.Label="Can LightDismiss" IsChecked="{Binding CanLightDismiss}" />
<CheckBox u:FormItem.Label="FullScreen" IsChecked="{Binding FullScreen}" />
<CheckBox u:FormItem.Label="CanResize" IsChecked="{Binding CanResize}" />
<ToggleSwitch
u:FormItem.Label="Global/Local OverlayHost"
IsChecked="{Binding IsLocal}"
@@ -150,6 +153,7 @@
<CheckBox u:FormItem.Label="Can DragMove" IsChecked="{Binding CanDragMove}" />
<CheckBox u:FormItem.Label="Can LightDismiss" IsChecked="{Binding CanLightDismiss}" />
<CheckBox u:FormItem.Label="FullScreen" IsChecked="{Binding FullScreen}" />
<CheckBox u:FormItem.Label="CanResize" IsChecked="{Binding CanResize}" />
<ToggleSwitch
u:FormItem.Label="Global/Local OverlayHost"
IsChecked="{Binding IsLocal}"

View File

@@ -27,6 +27,7 @@
<CheckBox u:FormItem.Label="Is Modal" IsChecked="{Binding IsModal}"/>
<CheckBox u:FormItem.Label="Is Close Button Visible" IsChecked="{Binding IsCloseButtonVisible}" IsThreeState="True"/>
<CheckBox u:FormItem.Label="Custom Dialog" IsChecked="{Binding Custom}"/>
<CheckBox u:FormItem.Label="CanResize" IsChecked="{Binding CanResize}" />
<ToggleSwitch
u:FormItem.Label="Global/Local OverlayHost"
IsChecked="{Binding IsLocal}"

View File

@@ -32,6 +32,7 @@ public partial class DefaultWindowDialogDemoViewModel: ObservableObject
[ObservableProperty] private bool _showInTaskBar;
[ObservableProperty] private bool? _isCloseButtonVisible;
[ObservableProperty] private bool _canDragMove;
[ObservableProperty] private bool _canResize;
public ICommand ShowDialogCommand { get; }
@@ -55,6 +56,7 @@ public partial class DefaultWindowDialogDemoViewModel: ObservableObject
IsCloseButtonVisible = IsCloseButtonVisible,
StartupLocation = Location,
CanDragMove = CanDragMove,
CanResize = CanResize,
};
if (X.HasValue && Y.HasValue)
{
@@ -74,6 +76,7 @@ public partial class CustomWindowDialogDemoViewModel: ObservableObject
[ObservableProperty] private bool? _isCloseButtonVisible;
[ObservableProperty] private bool _isModal;
[ObservableProperty] private bool _canDragMove;
[ObservableProperty] private bool _canResize;
public ICommand ShowDialogCommand { get; }
@@ -94,6 +97,7 @@ public partial class CustomWindowDialogDemoViewModel: ObservableObject
IsCloseButtonVisible = IsCloseButtonVisible,
StartupLocation = Location,
CanDragMove = CanDragMove,
CanResize = CanResize,
};
if (X.HasValue && Y.HasValue)
{
@@ -128,6 +132,7 @@ public partial class DefaultOverlayDialogDemoViewModel : ObservableObject
[ObservableProperty] private bool? _isCloseButtonVisible;
[ObservableProperty] private bool _isModal;
[ObservableProperty] private bool _isLocal;
[ObservableProperty] private bool _canResize;
public ICommand ShowDialogCommand { get; }
@@ -157,6 +162,7 @@ public partial class DefaultOverlayDialogDemoViewModel : ObservableObject
CanLightDismiss = CanLightDismiss,
CanDragMove = CanDragMove,
IsCloseButtonVisible = IsCloseButtonVisible,
CanResize = CanResize,
};
string? dialogHostId = IsLocal ? DialogDemoViewModel.LocalHost : null;
if (IsModal)
@@ -183,6 +189,7 @@ public partial class CustomOverlayDialogDemoViewModel: ObservableObject
[ObservableProperty] private bool? _isCloseButtonVisible;
[ObservableProperty] private bool _isModal;
[ObservableProperty] private bool _isLocal;
[ObservableProperty] private bool _canResize;
public ICommand ShowDialogCommand { get; }
@@ -208,6 +215,7 @@ public partial class CustomOverlayDialogDemoViewModel: ObservableObject
CanLightDismiss = CanLightDismiss,
CanDragMove = CanDragMove,
IsCloseButtonVisible = IsCloseButtonVisible,
CanResize = CanResize,
};
var dialogHostId = IsLocal ? DialogDemoViewModel.LocalHost : null;
if (IsModal)

View File

@@ -24,6 +24,7 @@ public partial class DrawerDemoViewModel : ObservableObject
[ObservableProperty] private bool _custom;
[ObservableProperty] private bool _isLocal;
[ObservableProperty] private bool _canResize;
public DrawerDemoViewModel()
{
@@ -42,6 +43,7 @@ public partial class DrawerDemoViewModel : ObservableObject
CanLightDismiss = CanLightDismiss,
IsCloseButtonVisible = IsCloseButtonVisible,
Title = Title,
CanResize = CanResize,
};
var hostId = IsLocal ? "LocalHost" : null;
if (Custom)