feat: basic position.
This commit is contained in:
@@ -5,11 +5,13 @@
|
||||
mc:Ignorable="d" d:DesignWidth="800"
|
||||
xmlns:vm="clr-namespace:Ursa.Demo.ViewModels;assembly=Ursa.Demo"
|
||||
xmlns:u="https://irihi.tech/ursa"
|
||||
xmlns:common="clr-namespace:Ursa.Common;assembly=Ursa"
|
||||
x:DataType="vm:DrawerDemoViewModel"
|
||||
x:CompileBindings="True"
|
||||
d:DesignHeight="450"
|
||||
x:Class="Ursa.Demo.Pages.DrawerDemo">
|
||||
<Canvas HorizontalAlignment="Left" Width="500">
|
||||
<StackPanel HorizontalAlignment="Left" >
|
||||
<u:EnumSelector EnumType="{x:Type common:Position}" Value="{Binding SelectedPosition}"></u:EnumSelector>
|
||||
<Button Content="Call Drawer" HorizontalAlignment="Stretch" Command="{Binding OpenDrawerCommand}"></Button>
|
||||
</Canvas>
|
||||
</StackPanel>
|
||||
</UserControl>
|
||||
|
||||
@@ -3,13 +3,18 @@ using System.Windows.Input;
|
||||
using Avalonia.Controls;
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using Ursa.Common;
|
||||
using Ursa.Controls;
|
||||
using Ursa.Controls.Options;
|
||||
|
||||
namespace Ursa.Demo.ViewModels;
|
||||
|
||||
public class DrawerDemoViewModel: ObservableObject
|
||||
public partial class DrawerDemoViewModel: ObservableObject
|
||||
{
|
||||
public ICommand OpenDrawerCommand { get; set; }
|
||||
|
||||
[ObservableProperty] private Position _selectedPosition;
|
||||
|
||||
|
||||
public DrawerDemoViewModel()
|
||||
{
|
||||
@@ -18,6 +23,6 @@ public class DrawerDemoViewModel: ObservableObject
|
||||
|
||||
private async Task OpenDrawer()
|
||||
{
|
||||
await Drawer.Show<Calendar, string, bool>("Hello World");
|
||||
await Drawer.ShowCustom<Calendar, string, bool>("Hello World", new CustomDrawerOptions() { Position = SelectedPosition, MinWidth = 400 });
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user