chore: update MainContent.

This commit is contained in:
NaBian committed 2023-01-20 23:11:32 +08:00
1 parent bec25d7f64
commit 34054286e7
2 files changed
+56 -56

No files matched your search

@@ -1,34 +1,30 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" <ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:hc="https://handyorg.github.io/handycontrol" xmlns:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit" xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension">
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:hc="https://handyorg.github.io/handycontrol"
xmlns:avalonedit="http://icsharpcode.net/sharpdevelop/avalonedit"
xmlns:ex="clr-namespace:HandyControlDemo.Tools.Extension">
<ResourceDictionary.MergedDictionaries> <ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../Basic/Geometries.xaml"/> <ResourceDictionary Source="../Basic/Geometries.xaml" />
<ResourceDictionary Source="../Basic/Fonts.xaml"/> <ResourceDictionary Source="../Basic/Fonts.xaml" />
</ResourceDictionary.MergedDictionaries> </ResourceDictionary.MergedDictionaries>
<Style x:Key="CirclePanelButton" BasedOn="{StaticResource ButtonCustom}" TargetType="Button"> <Style x:Key="CirclePanelButton" BasedOn="{StaticResource ButtonCustom}" TargetType="Button">
<Setter Property="UseLayoutRounding" Value="False"/> <Setter Property="UseLayoutRounding" Value="False" />
<Setter Property="Height" Value="77"/> <Setter Property="Height" Value="77" />
<Setter Property="Width" Value="36.06"/> <Setter Property="Width" Value="36.06" />
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="Button"> <ControlTemplate TargetType="Button">
<hc:SimplePanel> <hc:SimplePanel>
<Path Data="{StaticResource CirclePanelDemoGeometry}" Fill="{DynamicResource PrimaryBrush}" Height="77" Width="36.06"/> <Path Data="{StaticResource CirclePanelDemoGeometry}" Fill="{DynamicResource PrimaryBrush}" Height="77" Width="36.06" />
<Path Data="{StaticResource CirclePanelRightGeometry}" Stretch="Uniform" Margin="12" Fill="White"/> <Path Data="{StaticResource CirclePanelRightGeometry}" Stretch="Uniform" Margin="12" Fill="White" />
</hc:SimplePanel> </hc:SimplePanel>
<ControlTemplate.Triggers> <ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True"> <Trigger Property="IsMouseOver" Value="True">
<Setter Property="Opacity" Value=".9"/> <Setter Property="Opacity" Value=".9" />
</Trigger> </Trigger>
<Trigger Property="IsPressed" Value="True"> <Trigger Property="IsPressed" Value="True">
<Setter Property="Opacity" Value=".6"/> <Setter Property="Opacity" Value=".6" />
</Trigger> </Trigger>
<Trigger Property="IsEnabled" Value="False"> <Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.4"/> <Setter Property="Opacity" Value="0.4" />
</Trigger> </Trigger>
</ControlTemplate.Triggers> </ControlTemplate.Triggers>
</ControlTemplate> </ControlTemplate>
@@ -37,48 +33,48 @@
</Style> </Style>
<Style x:Key="TabItemTransparent" BasedOn="{StaticResource TabItemInLine}" TargetType="TabItem"> <Style x:Key="TabItemTransparent" BasedOn="{StaticResource TabItemInLine}" TargetType="TabItem">
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="Transparent" />
</Style> </Style>
<Style x:Key="ListBoxItemTransparent" BasedOn="{StaticResource ListBoxItemBaseStyle}" TargetType="ListBoxItem"> <Style x:Key="ListBoxItemTransparent" BasedOn="{StaticResource ListBoxItemBaseStyle}" TargetType="ListBoxItem">
<Setter Property="Visibility" Value="{Binding IsVisible,Converter={StaticResource Boolean2VisibilityConverter}}"/> <Setter Property="Visibility" Value="{Binding IsVisible,Converter={StaticResource Boolean2VisibilityConverter}}" />
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="Transparent" />
</Style> </Style>
<Style x:Key="ListBoxTransparent" BasedOn="{StaticResource ListBoxBaseStyle}" TargetType="ListBox"> <Style x:Key="ListBoxTransparent" BasedOn="{StaticResource ListBoxBaseStyle}" TargetType="ListBox">
<Setter Property="hc:BorderElement.CornerRadius" Value="4"/> <Setter Property="hc:BorderElement.CornerRadius" Value="4" />
<Setter Property="Background" Value="Transparent"/> <Setter Property="Background" Value="Transparent" />
<Setter Property="ItemContainerStyle" Value="{StaticResource ListBoxItemTransparent}"/> <Setter Property="ItemContainerStyle" Value="{StaticResource ListBoxItemTransparent}" />
<Setter Property="hc:ScrollViewer.IsInertiaEnabled" Value="True"/> <Setter Property="hc:ScrollViewer.IsInertiaEnabled" Value="True" />
</Style> </Style>
<ItemsPanelTemplate x:Key="FluidMoveBehaviorWrapPanelItemsPanelTemplate"> <ItemsPanelTemplate x:Key="FluidMoveBehaviorWrapPanelItemsPanelTemplate">
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center" hc:PanelElement.FluidMoveBehavior="{StaticResource BehaviorXY200}"/> <WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center" hc:PanelElement.FluidMoveBehavior="{StaticResource BehaviorXY200}" />
</ItemsPanelTemplate> </ItemsPanelTemplate>
<Style x:Key="MessageBoxCustom" TargetType="hc:MessageBox" BasedOn="{StaticResource {x:Type hc:MessageBox}}"> <Style x:Key="MessageBoxCustom" TargetType="hc:MessageBox" BasedOn="{StaticResource {x:Type hc:MessageBox}}">
<Setter Property="NonClientAreaBackground" Value="#262e2f"/> <Setter Property="NonClientAreaBackground" Value="#262e2f" />
<Setter Property="OtherButtonHoverBackground" Value="#888580"/> <Setter Property="OtherButtonHoverBackground" Value="#888580" />
<Setter Property="OtherButtonForeground" Value="White"/> <Setter Property="OtherButtonForeground" Value="White" />
<Setter Property="OtherButtonHoverForeground" Value="White"/> <Setter Property="OtherButtonHoverForeground" Value="White" />
<Setter Property="NonClientAreaForeground" Value="White"/> <Setter Property="NonClientAreaForeground" Value="White" />
<Setter Property="CloseButtonForeground" Value="White"/> <Setter Property="CloseButtonForeground" Value="White" />
<Setter Property="Icon" Value="/HandyControlDemo;component/Resources/Img/icon.ico"/> <Setter Property="Icon" Value="/HandyControlDemo;component/Resources/Img/icon.ico" />
</Style> </Style>
<Style x:Key="TextBlockFabricIcons" TargetType="TextBlock"> <Style x:Key="TextBlockFabricIcons" TargetType="TextBlock">
<Setter Property="FontFamily" Value="{StaticResource FabricIcons}"/> <Setter Property="FontFamily" Value="{StaticResource FabricIcons}" />
<Setter Property="FontSize" Value="14"/> <Setter Property="FontSize" Value="14" />
</Style> </Style>
<Style TargetType="hc:Sprite" BasedOn="{StaticResource {x:Type hc:Sprite}}"> <Style TargetType="hc:Sprite" BasedOn="{StaticResource {x:Type hc:Sprite}}">
<Setter Property="Padding" Value="25"/> <Setter Property="Padding" Value="25" />
</Style> </Style>
<Storyboard x:Key="Custom1Transition" x:Shared="False"> <Storyboard x:Key="Custom1Transition" x:Shared="False">
<DoubleAnimation From="50" To="0" Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)"> <DoubleAnimation From="50" To="0" Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[3].(TranslateTransform.X)">
<DoubleAnimation.EasingFunction> <DoubleAnimation.EasingFunction>
<ElasticEase Oscillations="1"/> <ElasticEase Oscillations="1" />
</DoubleAnimation.EasingFunction> </DoubleAnimation.EasingFunction>
</DoubleAnimation> </DoubleAnimation>
</Storyboard> </Storyboard>
@@ -86,7 +82,7 @@
<Storyboard x:Key="Custom2Transition" x:Shared="False"> <Storyboard x:Key="Custom2Transition" x:Shared="False">
<DoubleAnimation From="10" To="0" Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)"> <DoubleAnimation From="10" To="0" Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[2].(RotateTransform.Angle)">
<DoubleAnimation.EasingFunction> <DoubleAnimation.EasingFunction>
<ElasticEase Oscillations="1"/> <ElasticEase Oscillations="1" />
</DoubleAnimation.EasingFunction> </DoubleAnimation.EasingFunction>
</DoubleAnimation> </DoubleAnimation>
</Storyboard> </Storyboard>
@@ -94,19 +90,19 @@
<Storyboard x:Key="Custom3Transition" x:Shared="False"> <Storyboard x:Key="Custom3Transition" x:Shared="False">
<DoubleAnimation From=".8" To="1" Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)"> <DoubleAnimation From=".8" To="1" Duration="0:0:0.4" Storyboard.TargetProperty="(UIElement.RenderTransform).(TransformGroup.Children)[0].(ScaleTransform.ScaleX)">
<DoubleAnimation.EasingFunction> <DoubleAnimation.EasingFunction>
<ElasticEase Oscillations="1"/> <ElasticEase Oscillations="1" />
</DoubleAnimation.EasingFunction> </DoubleAnimation.EasingFunction>
</DoubleAnimation> </DoubleAnimation>
</Storyboard> </Storyboard>
<Style x:Key="TextEditorCustom" TargetType="avalonedit:TextEditor"> <Style x:Key="TextEditorCustom" TargetType="avalonedit:TextEditor">
<Setter Property="IsReadOnly" Value="True"/> <Setter Property="IsReadOnly" Value="True" />
<Setter Property="FontFamily" Value="Consolas"/> <Setter Property="FontFamily" Value="Consolas" />
<Setter Property="Margin" Value="4"/> <Setter Property="Margin" Value="4" />
<Setter Property="ShowLineNumbers" Value="True"/> <Setter Property="ShowLineNumbers" Value="True" />
<Setter Property="LineNumbersForeground" Value="{DynamicResource EditorLineNumbersForeground}"/> <Setter Property="LineNumbersForeground" Value="{DynamicResource EditorLineNumbersForeground}" />
<Setter Property="Foreground" Value="{DynamicResource EditorForeground}"/> <Setter Property="Foreground" Value="{DynamicResource EditorForeground}" />
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/> <Setter Property="Background" Value="{DynamicResource RegionBrush}" />
<Setter Property="Template"> <Setter Property="Template">
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="avalonedit:TextEditor"> <ControlTemplate TargetType="avalonedit:TextEditor">
@@ -158,18 +154,18 @@
</Style> </Style>
<Style x:Key="Path4GeometryItem" TargetType="Path"> <Style x:Key="Path4GeometryItem" TargetType="Path">
<Setter Property="Margin" Value="10"/> <Setter Property="Margin" Value="10" />
<Setter Property="Data" Value="{Binding Info.Data,RelativeSource={RelativeSource AncestorType=Border}}"/> <Setter Property="Data" Value="{Binding Info.Data,RelativeSource={RelativeSource AncestorType=Border}}" />
<Setter Property="Fill" Value="{DynamicResource PrimaryBrush}"/> <Setter Property="Fill" Value="{DynamicResource PrimaryBrush}" />
<Setter Property="Width" Value="20"/> <Setter Property="Width" Value="20" />
<Setter Property="Height" Value="20"/> <Setter Property="Height" Value="20" />
<Setter Property="HorizontalAlignment" Value="Center"/> <Setter Property="HorizontalAlignment" Value="Center" />
<Setter Property="VerticalAlignment" Value="Center"/> <Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="Stretch" Value="Uniform"/> <Setter Property="Stretch" Value="Uniform" />
<Style.Triggers> <Style.Triggers>
<DataTrigger Binding="{Binding Info.Line,RelativeSource={RelativeSource AncestorType=Border}}" Value="True"> <DataTrigger Binding="{Binding Info.Line,RelativeSource={RelativeSource AncestorType=Border}}" Value="True">
<Setter Property="Fill" Value="{x:Null}"/> <Setter Property="Fill" Value="{x:Null}" />
<Setter Property="Stroke" Value="{DynamicResource PrimaryBrush}"/> <Setter Property="Stroke" Value="{DynamicResource PrimaryBrush}" />
</DataTrigger> </DataTrigger>
</Style.Triggers> </Style.Triggers>
</Style> </Style>
@@ -179,12 +175,16 @@
<Setter.Value> <Setter.Value>
<ControlTemplate TargetType="GroupItem"> <ControlTemplate TargetType="GroupItem">
<hc:SimpleStackPanel> <hc:SimpleStackPanel>
<hc:Divider Content="{ex:Lang Key={Binding Name}}" LineStrokeDashArray="2, 2" Padding="16,0" Margin="0,16,0,10"/> <hc:Divider Content="{ex:Lang Key={Binding Name}}" LineStrokeDashArray="2, 2" Padding="16,0" Margin="0,16,0,10" />
<ItemsPresenter Margin="{TemplateBinding Padding}"/> <ItemsPresenter Margin="{TemplateBinding Padding}" />
</hc:SimpleStackPanel> </hc:SimpleStackPanel>
</ControlTemplate> </ControlTemplate>
</Setter.Value> </Setter.Value>
</Setter> </Setter>
</Style> </Style>
<Style x:Key="TabControl.PreviewCode" BasedOn="{StaticResource TabControlInLine}" TargetType="TabControl">
<Setter Property="BorderThickness" Value="0 1 0 0" />
</Style>
</ResourceDictionary> </ResourceDictionary>
@@ -109,7 +109,7 @@ public partial class MainContent
BorderCode.Child = new TabControl BorderCode.Child = new TabControl
{ {
Style = ResourceHelper.GetResource<Style>("TabControlInLine"), Style = ResourceHelper.GetResource<Style>("TabControl.PreviewCode"),
Items = Items =
{ {
new TabItem new TabItem