123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142 |
- <ResourceDictionary xmlns="https://github.com/avaloniaui"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:content="clr-namespace:SukiUI.Content"
- xmlns:suki="clr-namespace:SukiUI.Controls"
- xmlns:theme="clr-namespace:SukiUI.Theme">
- <Design.PreviewWith>
- <suki:SukiSideMenu></suki:SukiSideMenu>
- </Design.PreviewWith>
- <ControlTheme x:Key="SukiSideMenuStyle" TargetType="suki:SukiSideMenu">
- <Setter Property="ScrollViewer.VerticalScrollBarVisibility" Value="Auto" />
- <Setter Property="Template">
- <ControlTemplate>
- <SplitView DisplayMode="CompactInline"
- IsPaneOpen="{TemplateBinding IsMenuExpanded}"
- OpenPaneLength="{TemplateBinding OpenPaneLength}">
- <SplitView.Pane>
- <Border>
- <Grid Background="Transparent">
- <suki:GlassCard Name="Glass" Classes=""
- BorderThickness="0,0,1,0"
- CornerRadius="0"
- IsAnimated="False" />
- <DockPanel>
- <Button Name="PART_SidebarToggleButton"
- Margin="7"
- HorizontalAlignment="{TemplateBinding TogglePaneButtonPosition}"
- VerticalAlignment="Top"
- Classes="Basic"
- Cursor="Hand"
- DockPanel.Dock="Top"
- IsVisible="{TemplateBinding SidebarToggleEnabled}">
- <Panel>
- <PathIcon Name="PART_ExpandIcon"
- Classes="Flippable"
- Width="12"
- Height="12"
- Data="{x:Static content:Icons.ChevronLeft}"
- Foreground="{DynamicResource SukiText}">
- <PathIcon.Transitions>
- <Transitions>
- <TransformOperationsTransition Property="RenderTransform" Duration="{StaticResource MediumAnimationDuration}" />
- </Transitions>
- </PathIcon.Transitions>
- </PathIcon>
- </Panel>
- </Button>
- <Grid MinHeight="{TemplateBinding HeaderMinHeight}"
- DockPanel.Dock="Top"
- IsVisible="{TemplateBinding IsMenuExpanded}">
- <ContentPresenter Content="{TemplateBinding HeaderContent}" />
- </Grid>
- <ContentControl Margin="0,0,0,12"
- Content="{TemplateBinding FooterContent}"
- DockPanel.Dock="Bottom"
- IsVisible="{TemplateBinding IsMenuExpanded}" />
- <Grid Name="PART_Spacer"
- Height="15"
- DockPanel.Dock="Top" />
- <DockPanel>
- <StackPanel IsVisible="{TemplateBinding IsSearchEnabled}" DockPanel.Dock="Top">
- <StackPanel.Styles>
- <Style Selector="suki|GlassCard.Search:pointerover, suki|GlassCard.Search:focus-within">
- <Setter Property="Width" Value="190"></Setter>
- <Setter Property="CornerRadius" Value="12" />
- </Style>
- </StackPanel.Styles>
- <suki:GlassCard Classes="Search" HorizontalAlignment="Right" IsAnimated="False" Width="42" Margin="15,10,15,15" CornerRadius="22" Height="42">
- <suki:GlassCard.Transitions>
- <Transitions>
- <CornerRadiusTransition Property="CornerRadius" Duration="0:0:0.35"></CornerRadiusTransition>
- <DoubleTransition Property="Width" Duration="0:0:0.35"></DoubleTransition>
- </Transitions>
- </suki:GlassCard.Transitions>
- <DockPanel Margin="-3,-1,0,0">
- <PathIcon Width="13" DockPanel.Dock="Left" VerticalAlignment="Center" Foreground="{DynamicResource SukiLowText}"
- Height="13"
- Data="{x:Static content:Icons.Search}" />
- <TextBox theme:TextBoxExtensions.AddDeleteButton="True" Classes="NoShadow" Text="{TemplateBinding SearchText, Mode=TwoWay}" BorderThickness="0" Watermark="Search"/>
- </DockPanel>
- </suki:GlassCard>
-
- <!-- <Border Height="1" Margin="20,0,20,15" Background="{DynamicResource SukiBorderBrush}"/> -->
- </StackPanel>
- <ScrollViewer Name="PART_ScrollViewer"
- AllowAutoHide="{TemplateBinding (ScrollViewer.AllowAutoHide)}"
- Background="{TemplateBinding Background}"
- BringIntoViewOnFocusChange="{TemplateBinding (ScrollViewer.BringIntoViewOnFocusChange)}"
- Classes="Stack"
- HorizontalScrollBarVisibility="{TemplateBinding (ScrollViewer.HorizontalScrollBarVisibility)}"
- HorizontalSnapPointsType="{TemplateBinding (ScrollViewer.HorizontalSnapPointsType)}"
- IsScrollChainingEnabled="{TemplateBinding (ScrollViewer.IsScrollChainingEnabled)}"
- VerticalScrollBarVisibility="{TemplateBinding (ScrollViewer.VerticalScrollBarVisibility)}"
- VerticalSnapPointsType="{TemplateBinding (ScrollViewer.VerticalSnapPointsType)}">
- <StackPanel theme:StackPanelExtensions.AnimatedScroll="True">
- <ItemsPresenter Name="PART_ItemsPresenter"
- Margin="{TemplateBinding Padding}"
- theme:ItemsPresenterExtensions.AnimatedScroll="True"
- ItemsPanel="{TemplateBinding ItemsPanel}" />
- </StackPanel>
- </ScrollViewer>
- </DockPanel>
- </DockPanel>
- </Grid>
- </Border>
- </SplitView.Pane>
- <Border Name="ContentBorder"
- Margin="0,0,0,0"
- Background="{DynamicResource SukiBackground}"
- BorderBrush="{DynamicResource SukiBorderBrush}"
- BorderThickness="0,0,0,0">
- <suki:SukiTransitioningContentControl Name="PART_TransitioningContentControl" />
- </Border>
- </SplitView>
- </ControlTemplate>
- </Setter>
- <Style Selector="^[IsToggleButtonVisible=False]">
- <Style Selector="^[IsMenuExpanded=False]">
- <Style Selector="^ /template/ Button#PART_SidebarToggleButton">
- <Setter Property="Opacity" Value="0" />
- <Setter Property="IsVisible" Value="False" />
- </Style>
- </Style>
- <Style Selector="^[IsMenuExpanded=True]">
- <Style Selector="^ /template/ Button#PART_SidebarToggleButton">
- <Setter Property="Opacity" Value="0" />
- <Setter Property="IsHitTestVisible" Value="False" />
- </Style>
- </Style>
- </Style>
- <Style Selector="^[IsMenuExpanded=False]">
- <Style Selector="^ /template/ PathIcon#PART_ExpandIcon">
- <Setter Property="RenderTransform" Value="rotate(-180deg)" />
- </Style>
- <Style Selector="^ /template/ Grid#PART_Spacer">
- <Setter Property="Height" Value="0" />
- </Style>
- </Style>
- </ControlTheme>
- <ControlTheme x:Key="{x:Type suki:SukiSideMenu}"
- BasedOn="{StaticResource SukiSideMenuStyle}"
- TargetType="suki:SukiSideMenu" />
- </ResourceDictionary>
|