Skip to content

Commit

Permalink
Merge pull request #305 from yuzh0816/main
Browse files Browse the repository at this point in the history
Add IsVisiable property to Expand button
  • Loading branch information
kikipoulet authored Oct 14, 2024
2 parents da9b61c + 647e180 commit a7d524b
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 6 deletions.
13 changes: 7 additions & 6 deletions SukiUI/Controls/SukiSideMenu.axaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,14 @@
VerticalAlignment="Top"
Classes="Basic"
Cursor="Hand"
DockPanel.Dock="Top">
DockPanel.Dock="Top"
IsVisible="{TemplateBinding SidebarToggleEnabled}">
<Panel>
<PathIcon Name="PART_ExpandIcon"
Width="12"
Height="12"
Data="{x:Static content:Icons.ChevronLeft}"
Foreground="{DynamicResource SukiText}">
Width="12"
Height="12"
Data="{x:Static content:Icons.ChevronLeft}"
Foreground="{DynamicResource SukiText}">
<PathIcon.Transitions>
<Transitions>
<TransformOperationsTransition Property="RenderTransform" Duration="{StaticResource MediumAnimationDuration}" />
Expand All @@ -42,7 +43,7 @@
</PathIcon>
</Panel>
</Button>
<Grid MinHeight="{TemplateBinding HeaderMinHeight}"
<Grid MinHeight="{TemplateBinding HeaderMinHeight}"
DockPanel.Dock="Top"
IsVisible="{TemplateBinding IsMenuExpanded}">
<ContentPresenter Content="{TemplateBinding HeaderContent}" />
Expand Down
9 changes: 9 additions & 0 deletions SukiUI/Controls/SukiSideMenu.axaml.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ public class SukiSideMenu : SelectingItemsControl
public static readonly StyledProperty<bool> IsSearchEnabledProperty =
AvaloniaProperty.Register<SukiSideMenu, bool>(nameof(IsSearchEnabled), defaultValue: false);

public static readonly StyledProperty<bool> SidebarToggleEnabledProperty =
AvaloniaProperty.Register<SukiWindow, bool>(nameof(SidebarToggleEnabled), defaultValue: true);

public bool SidebarToggleEnabled
{
get => GetValue(SidebarToggleEnabledProperty);
set => SetValue(SidebarToggleEnabledProperty, value);
}

public bool IsSearchEnabled
{
get => GetValue(IsSearchEnabledProperty);
Expand Down

0 comments on commit a7d524b

Please sign in to comment.