diff --git a/demo/Ursa.Demo/Dialogs/DialogWithAction.axaml b/demo/Ursa.Demo/Dialogs/DialogWithAction.axaml
index 2f4bef9..7ab2c67 100644
--- a/demo/Ursa.Demo/Dialogs/DialogWithAction.axaml
+++ b/demo/Ursa.Demo/Dialogs/DialogWithAction.axaml
@@ -1,25 +1,43 @@
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
A
B
C
-
+
diff --git a/demo/Ursa.Demo/ViewModels/DrawerDemoViewModel.cs b/demo/Ursa.Demo/ViewModels/DrawerDemoViewModel.cs
index 7786715..68f884c 100644
--- a/demo/Ursa.Demo/ViewModels/DrawerDemoViewModel.cs
+++ b/demo/Ursa.Demo/ViewModels/DrawerDemoViewModel.cs
@@ -6,6 +6,7 @@ using CommunityToolkit.Mvvm.Input;
using Ursa.Common;
using Ursa.Controls;
using Ursa.Controls.Options;
+using Ursa.Demo.Dialogs;
namespace Ursa.Demo.ViewModels;
@@ -23,6 +24,7 @@ public partial class DrawerDemoViewModel: ObservableObject
private async Task OpenDrawer()
{
- await Drawer.ShowCustom("Hello World", new CustomDrawerOptions() { Position = SelectedPosition, MinWidth = 400 });
+ await Drawer.ShowCustom(new DialogWithActionViewModel(),
+ new CustomDrawerOptions() { Position = SelectedPosition, MinWidth = 400, MinHeight = 400});
}
}
\ No newline at end of file
diff --git a/src/Ursa.Themes.Semi/Controls/Dialog.axaml b/src/Ursa.Themes.Semi/Controls/Dialog.axaml
index b17f16c..5980151 100644
--- a/src/Ursa.Themes.Semi/Controls/Dialog.axaml
+++ b/src/Ursa.Themes.Semi/Controls/Dialog.axaml
@@ -135,6 +135,11 @@
+
+
+
+
+
+
+
+
+
diff --git a/src/Ursa/Controls/OverlayShared/OverlayDialogHost.Drawer.cs b/src/Ursa/Controls/OverlayShared/OverlayDialogHost.Drawer.cs
index f0252b4..cf8d932 100644
--- a/src/Ursa/Controls/OverlayShared/OverlayDialogHost.Drawer.cs
+++ b/src/Ursa/Controls/OverlayShared/OverlayDialogHost.Drawer.cs
@@ -46,6 +46,30 @@ public partial class OverlayDialogHost
control.Width = this.Bounds.Width;
}
}
+
+ private static void ResetDrawerPosition(DrawerControlBase control, Size newSize)
+ {
+ if (control.Position == Position.Right)
+ {
+ control.Height = newSize.Height;
+ SetLeft(control, newSize.Width - control.Bounds.Width);
+ }
+ else if (control.Position == Position.Left)
+ {
+ control.Height = newSize.Height;
+ SetLeft(control, 0);
+ }
+ else if (control.Position == Position.Bottom)
+ {
+ control.Width = newSize.Width;
+ SetTop(control, 0);
+ }
+ else
+ {
+ control.Width = newSize.Width;
+ SetTop(control, newSize.Height-control.Bounds.Height);
+ }
+ }
private Animation CreateAnimation(Size elementBounds, Position position, bool appear = true)
{
diff --git a/src/Ursa/Controls/OverlayShared/OverlayDialogHost.Shared.cs b/src/Ursa/Controls/OverlayShared/OverlayDialogHost.Shared.cs
index 24ad63f..f1e87a4 100644
--- a/src/Ursa/Controls/OverlayShared/OverlayDialogHost.Shared.cs
+++ b/src/Ursa/Controls/OverlayShared/OverlayDialogHost.Shared.cs
@@ -130,6 +130,10 @@ public partial class OverlayDialogHost: Canvas
{
ResetDialogPosition(d, e.NewSize);
}
+ else if (_layers[i].Element is DrawerControlBase drawer)
+ {
+ ResetDrawerPosition(drawer, e.NewSize);
+ }
}
}