227 lines
17 KiB
XML
227 lines
17 KiB
XML
<ResourceDictionary
|
|
xmlns="https://github.com/avaloniaui"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:c="clr-namespace:Ursa.Themes.Semi.Converters"
|
|
xmlns:u="https://irihi.tech/ursa">
|
|
<ControlTheme x:Key="{x:Type u:CustomDrawerControl}" TargetType="u:CustomDrawerControl">
|
|
<Setter Property="VerticalAlignment" Value="Stretch" />
|
|
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
|
<Setter Property="MinWidth" Value="96" />
|
|
<Setter Property="MinHeight" Value="96" />
|
|
<Setter Property="Padding" Value="{DynamicResource DrawerMargin}" />
|
|
<Setter Property="BorderThickness" Value="{DynamicResource DrawerBorderThickness}" />
|
|
<Setter Property="CornerRadius" Value="{DynamicResource DrawerCornerRadius}" />
|
|
<Setter Property="Template">
|
|
<ControlTemplate TargetType="u:CustomDrawerControl">
|
|
<Panel>
|
|
<Border
|
|
Name="PART_Root"
|
|
Margin="{TemplateBinding Padding,
|
|
Converter={x:Static c:ThicknessTakeConverter.Left}}"
|
|
Padding="0"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch"
|
|
BorderThickness="{TemplateBinding BorderThickness,
|
|
Converter={x:Static c:ThicknessTakeConverter.Left}}"
|
|
Classes="Shadow"
|
|
ClipToBounds="False"
|
|
CornerRadius="{TemplateBinding CornerRadius,
|
|
Converter={x:Static c:CornerRadiusTakeConverter.Left}}"
|
|
Focusable="True"
|
|
IsHitTestVisible="True"
|
|
Theme="{DynamicResource CardBorder}">
|
|
<Border ClipToBounds="True" CornerRadius="{Binding #PART_Root.CornerRadius}">
|
|
<Grid RowDefinitions="Auto, *">
|
|
<ContentPresenter
|
|
Name="PART_ContentPresenter"
|
|
Grid.Row="0"
|
|
Grid.RowSpan="2"
|
|
Content="{TemplateBinding Content}" />
|
|
<Grid Grid.Row="0" ColumnDefinitions="*, Auto">
|
|
<Panel
|
|
Name="{x:Static u:DialogControlBase.PART_TitleArea}"
|
|
Grid.Column="0"
|
|
Grid.ColumnSpan="2"
|
|
Background="Transparent" />
|
|
<Button
|
|
Name="{x:Static u:MessageBoxWindow.PART_CloseButton}"
|
|
Grid.Column="1"
|
|
Margin="0,24,24,0"
|
|
DockPanel.Dock="Right"
|
|
Theme="{DynamicResource OverlayCloseButton}" />
|
|
</Grid>
|
|
</Grid>
|
|
</Border>
|
|
</Border>
|
|
<u:DialogResizer IsVisible="{TemplateBinding CanResize}" />
|
|
</Panel>
|
|
</ControlTemplate>
|
|
</Setter>
|
|
<Style Selector="^[Position=Right] /template/ Border#PART_Root">
|
|
<Setter Property="Margin" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Padding, Converter={x:Static c:ThicknessTakeConverter.Left}}" />
|
|
<Setter Property="CornerRadius" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CornerRadius, Converter={x:Static c:CornerRadiusTakeConverter.Left}}" />
|
|
<Setter Property="BorderThickness" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness, Converter={x:Static c:ThicknessTakeConverter.Left}}" />
|
|
</Style>
|
|
<Style Selector="^[Position=Left] /template/ Border#PART_Root">
|
|
<Setter Property="Margin" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Padding, Converter={x:Static c:ThicknessTakeConverter.Right}}" />
|
|
<Setter Property="CornerRadius" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CornerRadius, Converter={x:Static c:CornerRadiusTakeConverter.Right}}" />
|
|
<Setter Property="BorderThickness" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness, Converter={x:Static c:ThicknessTakeConverter.Right}}" />
|
|
</Style>
|
|
<Style Selector="^[Position=Top] /template/ Border#PART_Root">
|
|
<Setter Property="Margin" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Padding, Converter={x:Static c:ThicknessTakeConverter.Bottom}}" />
|
|
<Setter Property="CornerRadius" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CornerRadius, Converter={x:Static c:CornerRadiusTakeConverter.Bottom}}" />
|
|
<Setter Property="BorderThickness" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness, Converter={x:Static c:ThicknessTakeConverter.Bottom}}" />
|
|
</Style>
|
|
<Style Selector="^[Position=Bottom] /template/ Border#PART_Root">
|
|
<Setter Property="Margin" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Padding, Converter={x:Static c:ThicknessTakeConverter.Top}}" />
|
|
<Setter Property="CornerRadius" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CornerRadius, Converter={x:Static c:CornerRadiusTakeConverter.Top}}" />
|
|
<Setter Property="BorderThickness" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness, Converter={x:Static c:ThicknessTakeConverter.Top}}" />
|
|
</Style>
|
|
<Style Selector="^[Position=Top] /template/ u|DialogResizer">
|
|
<Setter Property="Margin" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Padding, Converter={x:Static c:ThicknessTakeConverter.Bottom}}" />
|
|
<Setter Property="ResizeDirection" Value="Bottom"/>
|
|
</Style>
|
|
<Style Selector="^[Position=Bottom] /template/ u|DialogResizer">
|
|
<Setter Property="Margin" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Padding, Converter={x:Static c:ThicknessTakeConverter.Top}}" />
|
|
<Setter Property="ResizeDirection" Value="Top"/>
|
|
</Style>
|
|
<Style Selector="^[Position=Left] /template/ u|DialogResizer">
|
|
<Setter Property="Margin" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Padding, Converter={x:Static c:ThicknessTakeConverter.Right}}" />
|
|
<Setter Property="ResizeDirection" Value="Right"/>
|
|
</Style>
|
|
<Style Selector="^[Position=Right] /template/ u|DialogResizer">
|
|
<Setter Property="Margin" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Padding, Converter={x:Static c:ThicknessTakeConverter.Left}}" />
|
|
<Setter Property="ResizeDirection" Value="Left"/>
|
|
</Style>
|
|
</ControlTheme>
|
|
|
|
<ControlTheme x:Key="{x:Type u:DefaultDrawerControl}" TargetType="u:DefaultDrawerControl">
|
|
<Setter Property="VerticalAlignment" Value="Stretch" />
|
|
<Setter Property="HorizontalAlignment" Value="Stretch" />
|
|
<Setter Property="MinWidth" Value="96" />
|
|
<Setter Property="MinHeight" Value="96" />
|
|
<Setter Property="Padding" Value="{DynamicResource DrawerMargin}" />
|
|
<Setter Property="BorderThickness" Value="{DynamicResource DrawerBorderThickness}" />
|
|
<Setter Property="CornerRadius" Value="{DynamicResource DrawerCornerRadius}" />
|
|
<Setter Property="Template">
|
|
<ControlTemplate TargetType="u:DefaultDrawerControl">
|
|
<Panel>
|
|
<Border
|
|
Name="PART_Root"
|
|
Margin="{TemplateBinding Padding,
|
|
Converter={x:Static c:ThicknessTakeConverter.Left}}"
|
|
Padding="0"
|
|
HorizontalAlignment="Stretch"
|
|
VerticalAlignment="Stretch"
|
|
BorderThickness="{TemplateBinding BorderThickness,
|
|
Converter={x:Static c:ThicknessTakeConverter.Left}}"
|
|
Classes="Shadow"
|
|
ClipToBounds="False"
|
|
CornerRadius="{TemplateBinding CornerRadius,
|
|
Converter={x:Static c:CornerRadiusTakeConverter.Left}}"
|
|
Focusable="True"
|
|
IsHitTestVisible="True"
|
|
Theme="{DynamicResource CardBorder}">
|
|
<Border ClipToBounds="True" CornerRadius="{Binding #PART_Root.CornerRadius}">
|
|
<Grid RowDefinitions="Auto, *, Auto">
|
|
<ScrollViewer Grid.Row="1">
|
|
<ContentPresenter
|
|
Name="PART_ContentPresenter"
|
|
Margin="24,8"
|
|
Content="{TemplateBinding Content}" />
|
|
</ScrollViewer>
|
|
<Grid Grid.Row="0" ColumnDefinitions=" *, Auto">
|
|
<TextBlock
|
|
Name="PART_Title"
|
|
Grid.Column="0"
|
|
Margin="24,24,0,0"
|
|
VerticalAlignment="Center"
|
|
FontSize="16"
|
|
FontWeight="{DynamicResource TextBlockTitleFontWeight}"
|
|
IsHitTestVisible="False"
|
|
IsVisible="{TemplateBinding Title,
|
|
Converter={x:Static ObjectConverters.IsNotNull}}"
|
|
Text="{TemplateBinding Title}"
|
|
TextWrapping="Wrap" />
|
|
<Button
|
|
Name="{x:Static u:DrawerControlBase.PART_CloseButton}"
|
|
Grid.Column="1"
|
|
Margin="0,24,24,0"
|
|
DockPanel.Dock="Right"
|
|
Theme="{DynamicResource OverlayCloseButton}" />
|
|
</Grid>
|
|
<StackPanel
|
|
Grid.Row="2"
|
|
Margin="24,0,24,24"
|
|
HorizontalAlignment="Right"
|
|
Orientation="Horizontal">
|
|
<Button
|
|
Name="{x:Static u:DefaultDialogControl.PART_CancelButton}"
|
|
Margin="8,0,0,0"
|
|
Classes="Tertiary"
|
|
Content="{DynamicResource STRING_MENU_DIALOG_CANCEL}" />
|
|
<Button
|
|
Name="{x:Static u:DefaultDialogControl.PART_NoButton}"
|
|
Margin="8,0,0,0"
|
|
Classes="Danger"
|
|
Content="{DynamicResource STRING_MENU_DIALOG_NO}"
|
|
Theme="{DynamicResource SolidButton}" />
|
|
<Button
|
|
Name="{x:Static u:DefaultDialogControl.PART_YesButton}"
|
|
Margin="8,0,0,0"
|
|
Classes="Primary"
|
|
Content="{DynamicResource STRING_MENU_DIALOG_YES}"
|
|
Theme="{DynamicResource SolidButton}" />
|
|
<Button
|
|
Name="{x:Static u:DefaultDialogControl.PART_OKButton}"
|
|
Margin="8,0,0,0"
|
|
Classes="Primary"
|
|
Content="{DynamicResource STRING_MENU_DIALOG_OK}"
|
|
Theme="{DynamicResource SolidButton}" />
|
|
</StackPanel>
|
|
</Grid>
|
|
</Border>
|
|
</Border>
|
|
<u:DialogResizer IsVisible="{TemplateBinding CanResize}" />
|
|
</Panel>
|
|
</ControlTemplate>
|
|
</Setter>
|
|
<Style Selector="^[Position=Right] /template/ Border#PART_Root">
|
|
<Setter Property="Margin" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Padding, Converter={x:Static c:ThicknessTakeConverter.Left}}" />
|
|
<Setter Property="CornerRadius" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CornerRadius, Converter={x:Static c:CornerRadiusTakeConverter.Left}}" />
|
|
<Setter Property="BorderThickness" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness, Converter={x:Static c:ThicknessTakeConverter.Left}}" />
|
|
</Style>
|
|
<Style Selector="^[Position=Left] /template/ Border#PART_Root">
|
|
<Setter Property="Margin" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Padding, Converter={x:Static c:ThicknessTakeConverter.Right}}" />
|
|
<Setter Property="CornerRadius" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CornerRadius, Converter={x:Static c:CornerRadiusTakeConverter.Right}}" />
|
|
<Setter Property="BorderThickness" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness, Converter={x:Static c:ThicknessTakeConverter.Right}}" />
|
|
</Style>
|
|
<Style Selector="^[Position=Top] /template/ Border#PART_Root">
|
|
<Setter Property="Margin" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Padding, Converter={x:Static c:ThicknessTakeConverter.Bottom}}" />
|
|
<Setter Property="CornerRadius" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CornerRadius, Converter={x:Static c:CornerRadiusTakeConverter.Bottom}}" />
|
|
<Setter Property="BorderThickness" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness, Converter={x:Static c:ThicknessTakeConverter.Bottom}}" />
|
|
</Style>
|
|
<Style Selector="^[Position=Bottom] /template/ Border#PART_Root">
|
|
<Setter Property="Margin" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Padding, Converter={x:Static c:ThicknessTakeConverter.Top}}" />
|
|
<Setter Property="CornerRadius" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=CornerRadius, Converter={x:Static c:CornerRadiusTakeConverter.Top}}" />
|
|
<Setter Property="BorderThickness" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=BorderThickness, Converter={x:Static c:ThicknessTakeConverter.Top}}" />
|
|
</Style>
|
|
<Style Selector="^[Position=Top] /template/ u|DialogResizer">
|
|
<Setter Property="Margin" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Padding, Converter={x:Static c:ThicknessTakeConverter.Bottom}}" />
|
|
<Setter Property="ResizeDirection" Value="Bottom"/>
|
|
</Style>
|
|
<Style Selector="^[Position=Bottom] /template/ u|DialogResizer">
|
|
<Setter Property="Margin" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Padding, Converter={x:Static c:ThicknessTakeConverter.Top}}" />
|
|
<Setter Property="ResizeDirection" Value="Top"/>
|
|
</Style>
|
|
<Style Selector="^[Position=Left] /template/ u|DialogResizer">
|
|
<Setter Property="Margin" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Padding, Converter={x:Static c:ThicknessTakeConverter.Right}}" />
|
|
<Setter Property="ResizeDirection" Value="Right"/>
|
|
</Style>
|
|
<Style Selector="^[Position=Right] /template/ u|DialogResizer">
|
|
<Setter Property="Margin" Value="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=Padding, Converter={x:Static c:ThicknessTakeConverter.Left}}" />
|
|
<Setter Property="ResizeDirection" Value="Left"/>
|
|
</Style>
|
|
</ControlTheme>
|
|
</ResourceDictionary>
|