add brush example and label style
This commit is contained in:
1 parent
f53145e40b
commit
96c01500a9
54 files changed
+375
-248
No files matched your search
@@ -74,6 +74,8 @@
|
||||
|
||||
public static readonly string NaiveScrollViewerDemoCtl = nameof(NaiveScrollViewerDemoCtl);
|
||||
|
||||
public static readonly string BrushDemoCtl = nameof(BrushDemoCtl);
|
||||
|
||||
public static readonly string CommonWindow = nameof(CommonWindow);
|
||||
|
||||
public static readonly string CustomNonClientAreaWindow = nameof(CustomNonClientAreaWindow);
|
||||
|
||||
@@ -42,7 +42,8 @@ var styleList = new List<string>
|
||||
"TreeViewDemoCtl",
|
||||
"BorderDemoCtl",
|
||||
"RadioButtonDemoCtl",
|
||||
"NaiveScrollViewerDemoCtl"
|
||||
"NaiveScrollViewerDemoCtl",
|
||||
"BrushDemoCtl"
|
||||
};
|
||||
var windowList = new List<string>
|
||||
{
|
||||
|
||||
@@ -33,6 +33,9 @@
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>Resources\Img\icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="CommonServiceLocator, Version=2.0.2.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\CommonServiceLocator.2.0.2\lib\net45\CommonServiceLocator.dll</HintPath>
|
||||
@@ -135,6 +138,9 @@
|
||||
<Compile Include="UserControl\Styles\BorderDemoCtl.xaml.cs">
|
||||
<DependentUpon>BorderDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UserControl\Styles\BrushDemoCtl.xaml.cs">
|
||||
<DependentUpon>BrushDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="UserControl\Styles\ButtonDemoCtl.xaml.cs">
|
||||
<DependentUpon>ButtonDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -261,10 +267,6 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Resources\Themes\Styles\Label.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Resources\Themes\Styles\Style.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -349,6 +351,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="UserControl\Styles\BrushDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="UserControl\Styles\ButtonDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
@@ -477,6 +483,8 @@
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
||||
</Content>
|
||||
<Resource Include="Resources\Img\icon.ico" />
|
||||
<Resource Include="Resources\Img\LeftMainContent\Brush_16x.png" />
|
||||
<Resource Include="Resources\Img\Avatar\avatar1.png" />
|
||||
<Resource Include="Resources\Img\Avatar\avatar2.png" />
|
||||
<Resource Include="Resources\Img\Avatar\avatar3.png" />
|
||||
|
||||
@@ -114,6 +114,15 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 画刷 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string Brush {
|
||||
get {
|
||||
return ResourceManager.GetString("Brush", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 按钮 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
@@ -375,4 +375,7 @@
|
||||
<data name="Blog" xml:space="preserve">
|
||||
<value>Blog</value>
|
||||
</data>
|
||||
<data name="Brush" xml:space="preserve">
|
||||
<value>Brush</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -355,4 +355,7 @@
|
||||
<data name="Blog" xml:space="preserve">
|
||||
<value>博客</value>
|
||||
</data>
|
||||
<data name="Brush" xml:space="preserve">
|
||||
<value>画刷</value>
|
||||
</data>
|
||||
</root>
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 224 B |
Binary file not shown.
|
After Width: | Height: | Size: 422 KiB |
@@ -11,7 +11,7 @@
|
||||
<Setter Property="Width" Value="36.06"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Button}">
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Grid>
|
||||
<Path Data="{StaticResource CirclePanelDemoGeometry}" Fill="{DynamicResource PrimaryBrush}" Height="77" Width="36.06"/>
|
||||
<Path Data="{StaticResource CirclePanelRightGeometry}" Stretch="Uniform" Margin="12" Fill="White"/>
|
||||
|
||||
@@ -1,19 +0,0 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
|
||||
<Style x:Key="LabelInfo" TargetType="{x:Type Label}">
|
||||
<Setter Property="Margin" Value="0,32,16,0"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Left"/>
|
||||
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type Label}">
|
||||
<Border CornerRadius="4" Background="{TemplateBinding Background}">
|
||||
<TextBlock Foreground="White" Margin="10,6" Text="{TemplateBinding Content}"/>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -9,7 +9,7 @@
|
||||
<Style x:Key="ListBoxItemNew" BasedOn="{StaticResource ListBoxItemBaseStyle}" TargetType="ListBoxItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ListBoxItem}">
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||
@@ -23,7 +23,7 @@
|
||||
<Trigger Property="controls:EdgeElement.ShowEdgeContent" Value="true">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="{x:Type ListBoxItem}">
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<ContentControl Width="16" Height="16" Content="{Binding Path=(controls:EdgeElement.LeftContent),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
|
||||
@@ -2,7 +2,6 @@
|
||||
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="ListBoxItem.xaml"/>
|
||||
<ResourceDictionary Source="Label.xaml"/>
|
||||
<ResourceDictionary Source="Button.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
|
||||
@@ -6,7 +6,7 @@
|
||||
<controls:TransitioningContentControl>
|
||||
<controls:ScrollViewer HorizontalScrollBarVisibility="Auto">
|
||||
<StackPanel>
|
||||
<Label Style="{StaticResource LabelInfo}" Content="Default" Margin="32,32,0,0"/>
|
||||
<Label Style="{StaticResource LabelPrimary}" Content="Default" Margin="32,32,0,0" HorizontalAlignment="Left"/>
|
||||
<controls:TabControl Margin="32,16,32,0" Width="800" Height="300">
|
||||
<controls:TabItem Header="TabItem1">
|
||||
<Grid Background="White"/>
|
||||
@@ -31,10 +31,10 @@
|
||||
</controls:TabItem>
|
||||
</controls:TabControl>
|
||||
<StackPanel Orientation="Horizontal" Margin="32,32,32,16">
|
||||
<Label Style="{StaticResource LabelInfo}" Margin="0" Content="IsEnableTabFill = True"/>
|
||||
<Label Style="{StaticResource LabelInfo}" Margin="16,0,0,0" Content="ShowCloseButton = True"/>
|
||||
<Label Style="{StaticResource LabelInfo}" Margin="16,0,0,0" Content="IsDraggable = True"/>
|
||||
<Label Style="{StaticResource LabelInfo}" Margin="16,0,0,0" Content="IsEnableAnimation = True"/>
|
||||
<Label Style="{StaticResource LabelPrimary}" Margin="0" Content="IsEnableTabFill = True"/>
|
||||
<Label Style="{StaticResource LabelPrimary}" Margin="16,0,0,0" Content="ShowCloseButton = True"/>
|
||||
<Label Style="{StaticResource LabelPrimary}" Margin="16,0,0,0" Content="IsDraggable = True"/>
|
||||
<Label Style="{StaticResource LabelPrimary}" Margin="16,0,0,0" Content="IsEnableAnimation = True"/>
|
||||
</StackPanel>
|
||||
<controls:TabControl IsEnableAnimation="True" ShowCloseButton="True" IsDraggable="True" IsEnableTabFill="True" Margin="32,0,32,32" Width="800" Height="300">
|
||||
<controls:TabItem Header="TabItem1">
|
||||
|
||||
@@ -15,6 +15,11 @@
|
||||
</i:Interaction.Triggers>
|
||||
<TabItem Header="{x:Static langs:Lang.Styles}">
|
||||
<ListBox BorderThickness="0" SelectionMode="Single">
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.BrushDemoCtl}" Content="{x:Static langs:Lang.Brush}">
|
||||
<controls:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/Brush_16x.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.ButtonDemoCtl}" Content="{x:Static langs:Lang.Button}">
|
||||
<controls:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/ButtonClick_16x.png"/>
|
||||
@@ -25,17 +30,17 @@
|
||||
<Image Source="../../Resources/Img/LeftMainContent/Toggle_16x.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.RadioButtonDemoCtl}" Content="{x:Static langs:Lang.RadioButton}">
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.RadioButtonDemoCtl}" Content="{x:Static langs:Lang.RadioButton}">
|
||||
<controls:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/RadioButton_16x.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.CheckBoxDemoCtl}" Content="{x:Static langs:Lang.CheckBox}">
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.CheckBoxDemoCtl}" Content="{x:Static langs:Lang.CheckBox}">
|
||||
<controls:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/CheckBox_16x.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.NaiveScrollViewerDemoCtl}" Content="{x:Static langs:Lang.ScrollViewer}">
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.NaiveScrollViewerDemoCtl}" Content="{x:Static langs:Lang.ScrollViewer}">
|
||||
<controls:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/ScrollBox_16x.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
@@ -189,12 +194,12 @@
|
||||
<Image Source="../../Resources/Img/LeftMainContent/TabPage_16x.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.ScrollViewerDemoCtl}" Content="{x:Static langs:Lang.ScrollViewer}">
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.ScrollViewerDemoCtl}" Content="{x:Static langs:Lang.ScrollViewer}">
|
||||
<controls:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/ScrollBox_16x.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.WindowDemoCtl}" Content="{x:Static langs:Lang.Window}">
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.WindowDemoCtl}" Content="{x:Static langs:Lang.Window}">
|
||||
<controls:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/WindowsForm_16x.png"/>
|
||||
</controls:EdgeElement.LeftContent>
|
||||
|
||||
@@ -0,0 +1,43 @@
|
||||
<UserControl x:Class="HandyControlDemo.UserControl.BrushDemoCtl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
|
||||
Background="{DynamicResource RegionBrush}">
|
||||
<controls:TransitioningContentControl>
|
||||
<UniformGrid Margin="24" VerticalAlignment="Center" Columns="4" Rows="7">
|
||||
<Label Content="PrimaryBrush" Style="{StaticResource LabelPrimary}" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
<Label Content="DarkPrimaryBrush" Background="{DynamicResource DarkPrimaryBrush}" Foreground="White" BorderThickness="0" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
|
||||
<Label Content="DangerBrush" Style="{StaticResource LabelDanger}" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
<Label Content="DarkDangerBrush" Background="{DynamicResource DarkDangerBrush}" Foreground="White" BorderThickness="0" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
|
||||
<Label Content="WarningBrush" Style="{StaticResource LabelWarning}" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
<Label Content="DarkWarningBrush" Background="{DynamicResource DarkWarningBrush}" Foreground="White" BorderThickness="0" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
|
||||
<Label Content="InfoBrush" Style="{StaticResource LabelInfo}" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
<Label Content="DarkInfoBrush" Background="{DynamicResource DarkInfoBrush}" Foreground="White" BorderThickness="0" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
|
||||
<Label Content="SuccessBrush" Style="{StaticResource LabelSuccess}" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
<Label Content="DarkSuccessBrush" Background="{DynamicResource DarkSuccessBrush}" Foreground="White" BorderThickness="0" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
|
||||
<Label Content="AccentBrush" Background="{DynamicResource AccentBrush}" Foreground="White" BorderThickness="0" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
<Label Content="DarkAccentBrush" Background="{DynamicResource DarkAccentBrush}" Foreground="White" BorderThickness="0" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
<Label Content="PrimaryTextBrush" Background="{DynamicResource PrimaryTextBrush}" Foreground="{DynamicResource ThirdlyTextBrush}" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
<Label Content="SecondaryTextBrush" BorderThickness="0" Background="{DynamicResource SecondaryTextBrush}" Foreground="White" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
<Label Content="ThirdlyTextBrush" BorderThickness="0" Background="{DynamicResource ThirdlyTextBrush}" Foreground="White" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
<Label Content="ReverseTextBrush" BorderThickness="0" Background="{DynamicResource ReverseTextBrush}" Foreground="White" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
<Label Content="TextIconBrush" Background="{DynamicResource TextIconBrush}" Foreground="{DynamicResource ReverseTextBrush}" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
<Label Content="BorderBrush" BorderThickness="0" Background="{DynamicResource BorderBrush}" Foreground="{DynamicResource PrimaryTextBrush}" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
<Label Content="SecondaryBorderBrush" BorderThickness="0" Background="{DynamicResource SecondaryBorderBrush}" Foreground="White" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
<Label Content="BackgroundBrush" BorderThickness="0" Background="{DynamicResource BackgroundBrush}" Foreground="{DynamicResource ReverseTextBrush}" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
<Label Content="RegionBrush" Background="{DynamicResource RegionBrush}" Foreground="{DynamicResource PrimaryTextBrush}" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
<Label Content="SecondaryRegionBrush" BorderThickness="0" Background="{DynamicResource SecondaryRegionBrush}" Foreground="{DynamicResource PrimaryTextBrush}" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
<Label Content="ThirdlyRegionBrush" BorderThickness="0" Background="{DynamicResource ThirdlyRegionBrush}" Foreground="{DynamicResource TextIconBrush}" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
<Label Content="TitleBrush" BorderThickness="0" Background="{DynamicResource TitleBrush}" Foreground="White" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
<Label Content="DefaultBrush" Background="{DynamicResource DefaultBrush}" Foreground="{DynamicResource PrimaryTextBrush}" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
<Label Content="DarkDefaultBrush" BorderThickness="0" Background="{DynamicResource DarkDefaultBrush}" Foreground="{DynamicResource PrimaryTextBrush}" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
<Label Content="DarkMaskBrush" BorderThickness="0" Background="{DynamicResource DarkMaskBrush}" Foreground="{DynamicResource PrimaryTextBrush}" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
<Label Content="DarkOpacityBrush" BorderThickness="0" Background="{DynamicResource DarkOpacityBrush}" Foreground="White" Margin="8" HorizontalAlignment="Stretch"/>
|
||||
</UniformGrid>
|
||||
</controls:TransitioningContentControl>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,11 @@
|
||||
// ReSharper disable once CheckNamespace
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class BrushDemoCtl
|
||||
{
|
||||
public BrushDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in new issue
Block a user