From d9e38e9ee6ea7c2de66a7121789472833a7c765d Mon Sep 17 00:00:00 2001
From: chr <chrry550@163.com>
Date: 星期四, 29 二月 2024 11:40:06 +0800
Subject: [PATCH] 优化UI样式;
---
Style/Colors.xaml | 1
Style/ListViewStyle.xaml | 6
WPFProject.csproj | 4
UI/StepSetting.xaml | 6
UI/Test/ProgramList.xaml | 6
UI/Test/SequnceList.xaml | 8
Style/MainTab.xaml | 140 +++++++++++++++++++
Controls/MenuTabControl.xaml | 92 ++++++------
Resources/Font/iconfont.ttf | 0
Style/CommonTree.xaml | 51 +++++++
UI/Test/FunctionSetting.xaml | 96 ++++++++----
11 files changed, 320 insertions(+), 90 deletions(-)
diff --git a/Controls/MenuTabControl.xaml b/Controls/MenuTabControl.xaml
index 4f26381..b9a6ce9 100644
--- a/Controls/MenuTabControl.xaml
+++ b/Controls/MenuTabControl.xaml
@@ -14,9 +14,54 @@
<ResourceDictionary Source="/WPFProject;component/Style/colors.xaml"/>
</ResourceDictionary.MergedDictionaries>
+ <Style x:Key="tabItemStyle" TargetType="{x:Type ctl:IconTabItem}">
+ <Setter Property="Margin" Value="0"/>
+ <Setter Property="Background" Value="{StaticResource ButtonColor}"/>
+ <Setter Property="Foreground" Value="{StaticResource ButtonFont}"/>
+ <Setter Property="HeaderFontSize" Value="15"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate x:Name="ct" TargetType="{x:Type ctl:IconTabItem}">
+ <Border x:Name="templateRoot" BorderThickness="1,1,1,1" Padding="10"
+ BorderBrush="Gray"
+ Background="{TemplateBinding Background}">
+ <StackPanel HorizontalAlignment="Center">
+ <Image Width="30" Height="30" Source="{TemplateBinding Icon}"/>
+ <Label x:Name="txt" Visibility="Visible" BorderThickness="0"
+ VerticalContentAlignment="Center"
+ HorizontalAlignment="Left"
+ FontSize="{TemplateBinding HeaderFontSize}"
+ Content="{TemplateBinding Header}" ToolTip="{TemplateBinding Header}"
+ Foreground="{TemplateBinding Foreground}" />
+ </StackPanel>
+ </Border>
+ <ControlTemplate.Triggers>
+ <MultiDataTrigger>
+ <MultiDataTrigger.Conditions>
+ <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
+ </MultiDataTrigger.Conditions>
+ <Setter Property="BorderThickness" TargetName="templateRoot" Value="1,1,1,1"/>
+ <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ButtonFontSelected}"/>
+ </MultiDataTrigger>
+
+
+ <MultiDataTrigger>
+ <MultiDataTrigger.Conditions>
+ <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
+ </MultiDataTrigger.Conditions>
+ <Setter Property="Foreground" TargetName="txt" Value="{StaticResource ButtonFontSelected}"/>
+ <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ButtonSelected}"/>
+ </MultiDataTrigger>
+ </ControlTemplate.Triggers>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
<Style x:Key="ControlStyle" TargetType="{x:Type TabControl}">
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="BorderBrush" Value="Transparent"/>
+ <Setter Property="ItemContainerStyle" Value="{StaticResource tabItemStyle}"/>
<Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
<Setter Property="Template">
<Setter.Value>
@@ -92,57 +137,12 @@
</Setter.Value>
</Setter>
</Style>
-
- <Style x:Key="tabItemStyle" TargetType="{x:Type ctl:IconTabItem}">
- <Setter Property="Margin" Value="0"/>
- <Setter Property="Background" Value="{StaticResource ButtonColor}"/>
- <Setter Property="Foreground" Value="{StaticResource ButtonFont}"/>
- <Setter Property="HeaderFontSize" Value="15"/>
- <Setter Property="Template">
- <Setter.Value>
- <ControlTemplate x:Name="ct" TargetType="{x:Type ctl:IconTabItem}">
- <Border x:Name="templateRoot" BorderThickness="1,1,1,1" Padding="10"
- BorderBrush="Gray"
- Background="{TemplateBinding Background}">
- <StackPanel HorizontalAlignment="Center">
- <Image Width="30" Height="30" Source="{TemplateBinding Icon}"/>
- <Label x:Name="txt" Visibility="Visible" BorderThickness="0"
- VerticalContentAlignment="Center"
- HorizontalAlignment="Left"
- FontSize="{TemplateBinding HeaderFontSize}"
- Content="{TemplateBinding Header}" ToolTip="{TemplateBinding Header}"
- Foreground="{TemplateBinding Foreground}" />
- </StackPanel>
- </Border>
- <ControlTemplate.Triggers>
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="BorderThickness" TargetName="templateRoot" Value="1,1,1,1"/>
- <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource ButtonFontSelected}"/>
- </MultiDataTrigger>
-
-
- <MultiDataTrigger>
- <MultiDataTrigger.Conditions>
- <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
- </MultiDataTrigger.Conditions>
- <Setter Property="Foreground" TargetName="txt" Value="{StaticResource ButtonFontSelected}"/>
- <Setter Property="Background" TargetName="templateRoot" Value="{StaticResource ButtonSelected}"/>
- </MultiDataTrigger>
- </ControlTemplate.Triggers>
- </ControlTemplate>
- </Setter.Value>
- </Setter>
- </Style>
</ResourceDictionary>
</UserControl.Resources>
<Grid>
<TabControl x:Name="tabLevel_1"
- Style="{StaticResource ControlStyle}"
- ItemContainerStyle="{StaticResource tabItemStyle}" ItemsSource="{Binding Items}"
+ Style="{StaticResource ControlStyle}" ItemsSource="{Binding Items}"
SelectedItem="{Binding SelectedItem,Mode=TwoWay}"
SelectionChanged="tabLevel_1_SelectionChanged">
diff --git a/Resources/Font/iconfont.ttf b/Resources/Font/iconfont.ttf
index 9ee5c66..c116a10 100644
--- a/Resources/Font/iconfont.ttf
+++ b/Resources/Font/iconfont.ttf
Binary files differ
diff --git a/Style/Colors.xaml b/Style/Colors.xaml
index 2742d68..553baf9 100644
--- a/Style/Colors.xaml
+++ b/Style/Colors.xaml
@@ -5,6 +5,7 @@
<Brush x:Key="ChildBorder">#3692e1</Brush>
<Brush x:Key="MainStatusBar">#1d6eb2</Brush>
+ <Brush x:Key="SecondaryImportant">Orange</Brush>
<Brush x:Key="Important">#e17933</Brush>
diff --git a/Style/CommonTree.xaml b/Style/CommonTree.xaml
new file mode 100644
index 0000000..f442292
--- /dev/null
+++ b/Style/CommonTree.xaml
@@ -0,0 +1,51 @@
+锘�<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"
+ >
+ <ResourceDictionary.MergedDictionaries>
+ <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
+ <ResourceDictionary Source="/WPFProject;component/Style/colors.xaml"/>
+ </ResourceDictionary.MergedDictionaries>
+
+ <Style TargetType="TreeViewItem" BasedOn="{StaticResource TreeViewItemBaseStyle}">
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="TreeViewItem">
+ <Grid>
+ <Grid.RowDefinitions>
+ <RowDefinition MinHeight="{TemplateBinding MinHeight}"/>
+ <RowDefinition Height="Auto"/>
+ </Grid.RowDefinitions>
+ <Border x:Name="Bd" CornerRadius="{Binding Path=(hc:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
+ <DockPanel LastChildFill="True" Margin="{Binding Converter={StaticResource TreeViewItemMarginConverter}, RelativeSource={RelativeSource TemplatedParent}}">
+ <ToggleButton x:Name="Expander" ClickMode="Press" IsChecked="{Binding IsExpanded, RelativeSource={RelativeSource TemplatedParent}}" Style="{StaticResource ExpandCollapseToggleStyle}"/>
+ <ContentPresenter VerticalAlignment="Center" x:Name="PART_Header" ContentSource="Header" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
+ </DockPanel>
+ </Border>
+ <ItemsPresenter Grid.Row="1" x:Name="ItemsHost" />
+ </Grid>
+ <ControlTemplate.Triggers>
+ <Trigger Property="IsMouseOver" Value="true" SourceName="Bd">
+ <Setter Property="Background" TargetName="Bd" Value="{StaticResource SecondaryImportant}"/>
+ </Trigger>
+ <Trigger Property="IsExpanded" Value="false">
+ <Setter Property="Visibility" TargetName="ItemsHost" Value="Collapsed"/>
+ </Trigger>
+ <Trigger Property="HasItems" Value="false">
+ <Setter Property="Visibility" TargetName="Expander" Value="Hidden"/>
+ </Trigger>
+ <Trigger Property="IsSelected" Value="true">
+ <Setter Property="Background" TargetName="Bd" Value="{StaticResource Important}"/>
+ <Setter Property="Foreground" Value="{DynamicResource TextIconBrush}"/>
+ </Trigger>
+
+ <Trigger Property="IsEnabled" Value="false">
+ <Setter Property="Opacity" Value=".4" />
+ </Trigger>
+ </ControlTemplate.Triggers>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+</ResourceDictionary>
\ No newline at end of file
diff --git a/Style/ListViewStyle.xaml b/Style/ListViewStyle.xaml
index 923a9df..3147e36 100644
--- a/Style/ListViewStyle.xaml
+++ b/Style/ListViewStyle.xaml
@@ -18,8 +18,9 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type ListViewItem}">
- <Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
- <ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
+ <Border x:Name="Bd" MinHeight="30" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
+ <ContentPresenter x:Name="cp" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
+ SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Border>
<ControlTemplate.Triggers>
<MultiTrigger>
@@ -43,6 +44,7 @@
</MultiTrigger.Conditions>
<Setter Property="Background" TargetName="Bd" Value="#e17933"/>
<Setter Property="BorderBrush" TargetName="Bd" Value="#e17933"/>
+ <Setter Property="TextElement.Foreground" TargetName="cp" Value="#FFF"/>
</MultiTrigger>
<Trigger Property="IsEnabled" Value="False">
diff --git a/Style/MainTab.xaml b/Style/MainTab.xaml
index e372cd8..37f8ad6 100644
--- a/Style/MainTab.xaml
+++ b/Style/MainTab.xaml
@@ -1,5 +1,143 @@
锘�<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
>
-
+ <ResourceDictionary.MergedDictionaries>
+ <ResourceDictionary Source="/WPFProject;component/Style/colors.xaml"/>
+ </ResourceDictionary.MergedDictionaries>
+
+ <Style x:Key="tabItemStyle" TargetType="TabItem">
+ <Setter Property="Margin" Value="0"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate x:Name="ct" TargetType="TabItem">
+ <Border x:Name="templateRoot" BorderThickness="0,0,0,3" Padding="3,3,3,0"
+ BorderBrush="Transparent">
+ <Label x:Name="txt" Visibility="Visible" BorderThickness="0"
+ VerticalContentAlignment="Center"
+ HorizontalAlignment="Left"
+ Content="{TemplateBinding Header}" ToolTip="{TemplateBinding Header}"
+ Foreground="{TemplateBinding Foreground}" />
+ </Border>
+ <ControlTemplate.Triggers>
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type TabControl}}, Path=TabStripPlacement}" Value="Left">
+ <Setter Property="BorderThickness" TargetName="templateRoot" Value="0,0,3,0"/>
+ <Setter Property="Padding" TargetName="templateRoot" Value="3,3,0,3"/>
+ </DataTrigger>
+
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type TabControl}}, Path=TabStripPlacement}" Value="Right">
+ <Setter Property="BorderThickness" TargetName="templateRoot" Value="3,0,0,0"/>
+ <Setter Property="Padding" TargetName="templateRoot" Value="0,3,3,3"/>
+ </DataTrigger>
+
+ <DataTrigger Binding="{Binding RelativeSource={RelativeSource AncestorType={x:Type TabControl}}, Path=TabStripPlacement}" Value="Right">
+ <Setter Property="BorderThickness" TargetName="templateRoot" Value="0,3,0,0"/>
+ <Setter Property="Padding" TargetName="templateRoot" Value="3,0,3,3"/>
+ </DataTrigger>
+
+ <MultiDataTrigger>
+ <MultiDataTrigger.Conditions>
+ <Condition Binding="{Binding IsMouseOver, RelativeSource={RelativeSource Self}}" Value="true"/>
+ </MultiDataTrigger.Conditions>
+ <Setter Property="Foreground" TargetName="txt" Value="{StaticResource SecondaryImportant}"/>
+ </MultiDataTrigger>
+
+
+ <MultiDataTrigger>
+ <MultiDataTrigger.Conditions>
+ <Condition Binding="{Binding IsSelected, RelativeSource={RelativeSource Self}}" Value="true"/>
+ </MultiDataTrigger.Conditions>
+ <Setter Property="BorderBrush" TargetName="templateRoot" Value="{StaticResource Important}"/>
+ <Setter Property="Foreground" TargetName="txt" Value="{StaticResource Important}"/>
+ </MultiDataTrigger>
+ </ControlTemplate.Triggers>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
+
+ <Style x:Key="ControlStyle" TargetType="{x:Type TabControl}">
+ <Setter Property="BorderThickness" Value="0"/>
+ <Setter Property="ItemContainerStyle" Value="{StaticResource tabItemStyle}"/>
+ <Setter Property="Foreground" Value="{DynamicResource {x:Static SystemColors.ControlTextBrushKey}}"/>
+ <Setter Property="Template">
+ <Setter.Value>
+ <ControlTemplate TargetType="{x:Type TabControl}">
+ <Grid x:Name="templateRoot" ClipToBounds="True" SnapsToDevicePixels="True" KeyboardNavigation.TabNavigation="Local">
+ <Grid.ColumnDefinitions>
+ <ColumnDefinition x:Name="ColumnDefinition0" />
+ <ColumnDefinition x:Name="ColumnDefinition1" Width="0"/>
+ </Grid.ColumnDefinitions>
+ <Grid.RowDefinitions>
+ <RowDefinition x:Name="RowDefinition0" Height="Auto"/>
+ <RowDefinition x:Name="RowDefinition1" Height="*"/>
+ </Grid.RowDefinitions>
+
+ <ScrollViewer Grid.Row="0" Grid.Column="0"
+ VerticalScrollBarVisibility="Auto" HorizontalScrollBarVisibility="Auto" >
+ <StackPanel x:Name="HeaderPanel" Orientation="Horizontal"
+ ScrollViewer.HorizontalScrollBarVisibility="Auto"
+ IsItemsHost="True"
+ Background="White"
+ Margin="0" KeyboardNavigation.TabIndex="1"
+ Panel.ZIndex="1"/>
+
+ </ScrollViewer>
+
+ <!--<Line X1="0" X2="{Binding ActualWidth, RelativeSource={RelativeSource Self}}"
+ Stroke="Transparent" StrokeThickness="0.1"
+ VerticalAlignment="Bottom" Margin="0" SnapsToDevicePixels="True"/>-->
+ <Border x:Name="ContentPanel" BorderBrush="{TemplateBinding BorderBrush}"
+ BorderThickness="{TemplateBinding BorderThickness}"
+ Background="{TemplateBinding Background}"
+ Grid.Column="0" KeyboardNavigation.DirectionalNavigation="Contained"
+ Grid.Row="1" KeyboardNavigation.TabIndex="2"
+ KeyboardNavigation.TabNavigation="Local">
+ <ContentPresenter x:Name="PART_SelectedContentHost"
+ ContentTemplate="{TemplateBinding SelectedContentTemplate}"
+ Content="{TemplateBinding SelectedContent}"
+ ContentStringFormat="{TemplateBinding SelectedContentStringFormat}"
+ ContentSource="SelectedContent" Margin="0"
+ SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
+ </Border>
+ </Grid>
+ <ControlTemplate.Triggers>
+ <Trigger Property="TabStripPlacement" Value="Bottom">
+ <Setter Property="Grid.Row" TargetName="HeaderPanel" Value="1"/>
+ <Setter Property="Grid.Row" TargetName="ContentPanel" Value="0"/>
+ <Setter Property="Height" TargetName="RowDefinition0" Value="*"/>
+ <Setter Property="Height" TargetName="RowDefinition1" Value="Auto"/>
+ <Setter Property="Orientation" TargetName="HeaderPanel" Value="Horizontal"/>
+ </Trigger>
+ <Trigger Property="TabStripPlacement" Value="Left">
+ <Setter Property="Grid.Row" TargetName="HeaderPanel" Value="0"/>
+ <Setter Property="Grid.Row" TargetName="ContentPanel" Value="0"/>
+ <Setter Property="Grid.Column" TargetName="HeaderPanel" Value="0"/>
+ <Setter Property="Grid.Column" TargetName="ContentPanel" Value="1"/>
+ <Setter Property="Width" TargetName="ColumnDefinition0" Value="Auto"/>
+ <Setter Property="Width" TargetName="ColumnDefinition1" Value="*"/>
+ <Setter Property="Height" TargetName="RowDefinition0" Value="*"/>
+ <Setter Property="Height" TargetName="RowDefinition1" Value="0"/>
+
+ <Setter Property="Orientation" TargetName="HeaderPanel" Value="Vertical"/>
+ </Trigger>
+ <Trigger Property="TabStripPlacement" Value="Right">
+ <Setter Property="Grid.Row" TargetName="HeaderPanel" Value="0"/>
+ <Setter Property="Grid.Row" TargetName="ContentPanel" Value="0"/>
+ <Setter Property="Grid.Column" TargetName="HeaderPanel" Value="1"/>
+ <Setter Property="Grid.Column" TargetName="ContentPanel" Value="0"/>
+ <Setter Property="Width" TargetName="ColumnDefinition0" Value="*"/>
+ <Setter Property="Width" TargetName="ColumnDefinition1" Value="Auto"/>
+ <Setter Property="Height" TargetName="RowDefinition0" Value="*"/>
+ <Setter Property="Height" TargetName="RowDefinition1" Value="0"/>
+
+ <Setter Property="Orientation" TargetName="HeaderPanel" Value="Vertical"/>
+ </Trigger>
+ <Trigger Property="IsEnabled" Value="False">
+ <Setter Property="TextElement.Foreground" TargetName="templateRoot" Value="{DynamicResource {x:Static SystemColors.GrayTextBrushKey}}"/>
+ </Trigger>
+ </ControlTemplate.Triggers>
+ </ControlTemplate>
+ </Setter.Value>
+ </Setter>
+ </Style>
</ResourceDictionary>
\ No newline at end of file
diff --git a/UI/StepSetting.xaml b/UI/StepSetting.xaml
index 8e4d2a9..0157b96 100644
--- a/UI/StepSetting.xaml
+++ b/UI/StepSetting.xaml
@@ -12,11 +12,13 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/>
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
- <ResourceDictionary Source="/WPFProject;component/Style/colors.xaml"/>
+ <ResourceDictionary Source="/WPFProject;component/Style/colors.xaml"/>
+ <ResourceDictionary Source="/WPFProject;component/Style/MainTab.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style TargetType="Label"></Style>
<Style TargetType="ListView"></Style>
+ <Style TargetType="TabControl"/>
<Color x:Key="DarkPrimaryColor">#e17933</Color>
<Color x:Key="PrimaryColor">#e17933</Color>
@@ -27,7 +29,7 @@
</UserControl.Resources>
<Grid>
- <TabControl TabStripPlacement="Left">
+ <TabControl Style="{StaticResource ControlStyle}" TabStripPlacement="Left">
<TabItem Header="鍑芥暟鍒楄〃">
</TabItem>
<TabItem Header="鍙橀噺鍒楄〃">
diff --git a/UI/Test/FunctionSetting.xaml b/UI/Test/FunctionSetting.xaml
index 4b4334d..7cd077c 100644
--- a/UI/Test/FunctionSetting.xaml
+++ b/UI/Test/FunctionSetting.xaml
@@ -1,34 +1,62 @@
-锘�<UserControl x:Class="WPFProject.UI.Test.FunctionSetting"
- xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
- xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
- xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
- xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
- xmlns:local="clr-namespace:WPFProject.UI.Test"
- mc:Ignorable="d"
- d:DesignHeight="450" d:DesignWidth="800">
- <UserControl.Resources>
- <ResourceDictionary>
- <ResourceDictionary.MergedDictionaries>
- <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/>
- <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
- <ResourceDictionary Source="/WPFProject;component/Style/colors.xaml"/>
- </ResourceDictionary.MergedDictionaries>
-
- <Style TargetType="Label"></Style>
- <Style TargetType="ListView"></Style>
-
- </ResourceDictionary>
- </UserControl.Resources>
-
- <Grid>
- <TabControl>
- <TabItem Header="鍑芥暟鍒楄〃">
- <TreeView>
- <TreeViewItem></TreeViewItem>
- </TreeView>
- </TabItem>
- <TabItem Header="鍙橀噺鍒楄〃">
- </TabItem>
- </TabControl>
- </Grid>
-</UserControl>
+锘�<UserControl x:Class="WPFProject.UI.Test.FunctionSetting"
+ xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
+ xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
+ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
+ xmlns:local="clr-namespace:WPFProject.UI.Test"
+ xmlns:hc="https://handyorg.github.io/handycontrol"
+ mc:Ignorable="d"
+ d:DesignHeight="450" d:DesignWidth="800">
+ <UserControl.Resources>
+ <ResourceDictionary>
+ <ResourceDictionary.MergedDictionaries>
+ <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/>
+ <ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
+ <ResourceDictionary Source="/WPFProject;component/Style/colors.xaml"/>
+ <ResourceDictionary Source="/WPFProject;component/Style/CommonTree.xaml"/>
+ <ResourceDictionary Source="/WPFProject;component/Style/MainTab.xaml"/>
+ </ResourceDictionary.MergedDictionaries>
+ <Style TargetType="Label"/>
+
+ <Style TargetType="TabControl"/>
+
+
+
+
+ <Style TargetType="TreeView">
+
+
+
+ </Style>
+ </ResourceDictionary>
+ </UserControl.Resources>
+
+ <Grid>
+ <TabControl Style="{StaticResource ControlStyle}">
+
+ <TabItem Header="鍑芥暟鍒楄〃">
+ <StackPanel>
+ <hc:SearchBar hc:InfoElement.Placeholder="杈撳叆鏂囨湰鏌ヨ" Style="{StaticResource SearchBarPlus}" Margin="10,5,10,5"/>
+ <TreeView BorderThickness="0" >
+
+ <TreeViewItem Header="111">
+ <TreeViewItem Header="111">
+ <TreeViewItem Header="999"/>
+ </TreeViewItem>
+ <TreeViewItem Header="222"/>
+ <TreeViewItem Header="333"/>
+ </TreeViewItem>
+ <TreeViewItem Header="222">
+ <TreeViewItem Header="111"/>
+ <TreeViewItem Header="222"/>
+ <TreeViewItem Header="333"/>
+ </TreeViewItem>
+ </TreeView>
+ </StackPanel>
+
+ </TabItem>
+ <TabItem Header="鍙橀噺鍒楄〃">
+ </TabItem>
+ </TabControl>
+ </Grid>
+</UserControl>
diff --git a/UI/Test/ProgramList.xaml b/UI/Test/ProgramList.xaml
index 1a952b1..c6bae47 100644
--- a/UI/Test/ProgramList.xaml
+++ b/UI/Test/ProgramList.xaml
@@ -20,10 +20,12 @@
</UserControl.Resources>
<Grid>
- <ListView ItemsSource="{Binding Programs}" ItemContainerStyle="{StaticResource a}" SelectionChanged="ListView_SelectionChanged">
+ <ListView ItemsSource="{Binding Programs}" ItemContainerStyle="{StaticResource a}"
+ VerticalContentAlignment="Center"
+ SelectionChanged="ListView_SelectionChanged">
<ListView.ItemTemplate>
<DataTemplate>
- <Label Content="{Binding Name}"/>
+ <ContentControl Content="{Binding Name}"/>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
diff --git a/UI/Test/SequnceList.xaml b/UI/Test/SequnceList.xaml
index 5631baf..54a58d6 100644
--- a/UI/Test/SequnceList.xaml
+++ b/UI/Test/SequnceList.xaml
@@ -36,7 +36,7 @@
<ListView.ItemTemplate>
<DataTemplate>
- <Label Content="{Binding Name}"/>
+ <ContentControl Content="{Binding Name}"/>
</DataTemplate>
</ListView.ItemTemplate>
</ListView>
@@ -48,9 +48,11 @@
<RowDefinition Height="30"/>
<RowDefinition/>
</Grid.RowDefinitions>
- <Label Content="娴嬭瘯娴佺▼"></Label>
+ <Label Content="娴嬭瘯娴佺▼" VerticalContentAlignment="Center"/>
- <DataGrid x:Name="dataGrid" AutoGenerateColumns="False" FrozenColumnCount="1" Background="#FFF" Grid.Row="1" ItemsSource="{Binding Steps}">
+ <DataGrid x:Name="dataGrid" AutoGenerateColumns="False" FrozenColumnCount="1" Background="#FFF" Grid.Row="1"
+ BorderThickness="0"
+ ItemsSource="{Binding Steps}">
<DataGrid.Columns>
<DataGridTextColumn IsReadOnly="True" Width="80" CanUserResize="False" Binding="{Binding Index}" Header="搴忓彿"/>
diff --git a/WPFProject.csproj b/WPFProject.csproj
index 2cdc8ca..a395084 100644
--- a/WPFProject.csproj
+++ b/WPFProject.csproj
@@ -203,6 +203,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
+ <Page Include="Style\CommonTree.xaml">
+ <Generator>MSBuild:Compile</Generator>
+ <SubType>Designer</SubType>
+ </Page>
<Page Include="Style\MainTab.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
--
Gitblit v1.9.1