mirror of
https://gitee.com/chinware/atomui.git
synced 2024-12-04 04:48:08 +08:00
35 lines
747 B
C#
35 lines
747 B
C#
using AtomUI.Controls;
|
|
using Avalonia;
|
|
using Avalonia.Controls;
|
|
using Avalonia.Interactivity;
|
|
using Button = AtomUI.Controls.Button;
|
|
|
|
namespace AtomUI.Demo.Desktop.ShowCase;
|
|
|
|
public partial class DrawerShowCase : UserControl
|
|
{
|
|
public DrawerShowCase()
|
|
{
|
|
InitializeComponent();
|
|
}
|
|
|
|
private void Button_OnClick(object? sender, RoutedEventArgs e)
|
|
{
|
|
if (sender is not Button button)
|
|
{
|
|
return;
|
|
}
|
|
|
|
if (Drawer.GetDrawer(button) is not { } drawer)
|
|
{
|
|
return;
|
|
}
|
|
|
|
drawer.IsOpen = false;
|
|
}
|
|
|
|
private void ButtonOpenOnCurrentParent_OnClick(object? sender, RoutedEventArgs e)
|
|
{
|
|
Drawer1.OpenOn = Drawer1.OpenOn?.Parent as Visual;
|
|
}
|
|
} |