add repeatbutton style

This commit is contained in:
NaBian committed 2019-04-22 23:55:19 +08:00
1 parent edd502a056
commit 0465a69150
15 files changed
+267 -15

No files matched your search

@@ -19,6 +19,14 @@
<PackageReference Include="MvvmLightLibs" Version="5.4.1.1" />
<PackageReference Include="Newtonsoft.Json" Version="11.0.2" />
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.Designer.cs">
<Link>Properties\Langs\Lang.Designer.cs</Link>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Lang.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Compile Remove="Properties\AssemblyInfo.cs" />
<Compile Remove="Properties\Langs\Lang.en.Designer.cs" />
@@ -305,5 +313,15 @@
<Link>Resources\Img\under_construction.gif</Link>
</Resource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.en.resx">
<Link>Properties\Langs\Lang.en.resx</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.resx">
<Link>Properties\Langs\Lang.resx</Link>
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Lang.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<Import Project="..\..\Shared\HandyControlDemo_Shared\HandyControlDemo_Shared.projitems" Label="Shared" />
</Project>
@@ -16,6 +16,24 @@
<DefineConstants>TRACE;Core</DefineConstants>
<DocumentationFile>C:\Code\GitHub\HandyControl\src\Core_30\HandyControl_Core_30\HandyControl.xml</DocumentationFile>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Shared\HandyControl_Shared\Properties\Langs\Lang.Designer.cs">
<Link>Properties\Langs\Lang.Designer.cs</Link>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Lang.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="..\..\Shared\HandyControl_Shared\Properties\Langs\Lang.en.resx">
<Link>Properties\Langs\Lang.en.resx</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\..\Shared\HandyControl_Shared\Properties\Langs\Lang.resx">
<Link>Properties\Langs\Lang.resx</Link>
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Lang.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<Import Project="..\..\Shared\HandyControl_Shared\HandyControl_Shared.projitems" Label="Shared" />
<ItemGroup>
<None Remove="Themes\Styles\Base\TreeViewBaseStyle.xaml" />
@@ -73,6 +73,14 @@
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.Designer.cs">
<Link>Properties\Langs\Lang.Designer.cs</Link>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Lang.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\1.jpg">
<Link>Resources\Img\1.jpg</Link>
@@ -357,6 +365,16 @@
<Name>HandyControl_Net_40</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.en.resx">
<Link>Properties\Langs\Lang.en.resx</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.resx">
<Link>Properties\Langs\Lang.resx</Link>
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Lang.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<Import Project="..\..\Shared\HandyControlDemo_Shared\HandyControlDemo_Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -34,6 +34,14 @@
<DocumentationFile>bin\Release\HandyControl.xml</DocumentationFile>
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Shared\HandyControl_Shared\Properties\Langs\Lang.Designer.cs">
<Link>Properties\Langs\Lang.Designer.cs</Link>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Lang.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
@@ -79,6 +87,16 @@
<Version>3.0.1</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="..\..\Shared\HandyControl_Shared\Properties\Langs\Lang.en.resx">
<Link>Properties\Langs\Lang.en.resx</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\..\Shared\HandyControl_Shared\Properties\Langs\Lang.resx">
<Link>Properties\Langs\Lang.resx</Link>
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Lang.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<Import Project="..\..\Shared\HandyControl_Shared\HandyControl_Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -90,6 +90,12 @@
</PackageReference>
</ItemGroup>
<ItemGroup>
<Compile Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.Designer.cs">
<Link>Properties\Langs\Lang.Designer.cs</Link>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Lang.resx</DependentUpon>
</Compile>
<Compile Include="UserControl\Main\NoUserContent.xaml.cs">
<DependentUpon>NoUserContent.xaml</DependentUpon>
</Compile>
@@ -372,13 +378,22 @@
<Link>Resources\Img\under_construction.gif</Link>
</Resource>
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Page Include="UserControl\Main\NoUserContent.xaml">
<Generator>MSBuild:Compile</Generator>
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.en.resx">
<Link>Properties\Langs\Lang.en.resx</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.resx">
<Link>Properties\Langs\Lang.resx</Link>
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Lang.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<Import Project="..\..\Shared\HandyControlDemo_Shared\HandyControlDemo_Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -80,6 +80,14 @@
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<netVersion>netgt40</netVersion>
</PropertyGroup>
<ItemGroup>
<Compile Include="..\..\Shared\HandyControl_Shared\Properties\Langs\Lang.Designer.cs">
<Link>Properties\Langs\Lang.Designer.cs</Link>
<AutoGen>True</AutoGen>
<DesignTime>True</DesignTime>
<DependentUpon>Lang.resx</DependentUpon>
</Compile>
</ItemGroup>
<ItemGroup>
<Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" />
@@ -120,6 +128,16 @@
<SubType>Designer</SubType>
</Page>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="..\..\Shared\HandyControl_Shared\Properties\Langs\Lang.en.resx">
<Link>Properties\Langs\Lang.en.resx</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\..\Shared\HandyControl_Shared\Properties\Langs\Lang.resx">
<Link>Properties\Langs\Lang.resx</Link>
<Generator>PublicResXFileCodeGenerator</Generator>
<LastGenOutput>Lang.Designer.cs</LastGenOutput>
</EmbeddedResource>
</ItemGroup>
<Import Project="..\..\Shared\HandyControl_Shared\HandyControl_Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>
@@ -30,9 +30,7 @@
<SubType>Code</SubType>
<DependentUpon>MainWindow.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)Properties\AssemblyInfo.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Properties\Langs\Lang.Designer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Properties\Langs\Lang.en.Designer.cs" />
<!-- <Compile Include="$(MSBuildThisFileDirectory)Properties\Langs\Lang.Designer.cs" /> -->
<Compile Include="$(MSBuildThisFileDirectory)Service\DataService.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\String2BrushConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\StringRepeatConverter.cs" />
@@ -700,8 +698,4 @@
<Generator>MSBuild:Compile</Generator>
</ApplicationDefinition>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Properties\Langs\Lang.en.resx" />
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Properties\Langs\Lang.resx" />
</ItemGroup>
</Project>
@@ -1032,6 +1032,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 重复按钮 的本地化字符串。
/// </summary>
public static string RepeatButton {
get {
return ResourceManager.GetString("RepeatButton", resourceCulture);
}
}
/// <summary>
/// 查找类似 回复 的本地化字符串。
/// </summary>
Whitespace-only changes.
@@ -564,4 +564,7 @@
<data name="Click2Count" xml:space="preserve">
<value>Click to count</value>
</data>
<data name="RepeatButton" xml:space="preserve">
<value>RepeatButton</value>
</data>
</root>
@@ -564,4 +564,7 @@
<data name="Click2Count" xml:space="preserve">
<value>点击计数</value>
</data>
<data name="RepeatButton" xml:space="preserve">
<value>重复按钮</value>
</data>
</root>
@@ -196,9 +196,6 @@
<Compile Include="$(MSBuildThisFileDirectory)Interactivity\TriggerBase.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Interactivity\TriggerCollection.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Interactivity\TypeConstraintAttribute.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Properties\AssemblyInfo.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Properties\Langs\Lang.Designer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Properties\Langs\Lang.en.Designer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\Boolean2BooleanReConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\Boolean2StrConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\Boolean2VisibilityReConverter.cs" />
@@ -366,6 +363,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\Base\RepeatButtonBaseStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\Base\GotoTopBaseStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -618,6 +619,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\RepeatButton.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\RichTextBox.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@@ -703,8 +708,4 @@
<Generator>MSBuild:Compile</Generator>
</Page>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Properties\Langs\Lang.en.resx" />
<EmbeddedResource Include="$(MSBuildThisFileDirectory)Properties\Langs\Lang.resx" />
</ItemGroup>
</Project>
Whitespace-only changes.
@@ -0,0 +1,49 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="ButtonBaseStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style x:Key="RepeatButtonBaseStyle" BasedOn="{StaticResource ButtonBaseBaseStyle}" TargetType="RepeatButton">
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
<Setter Property="controls:BorderElement.CornerRadius" Value="4"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RepeatButton">
<controls:SimplePanel>
<Border Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}"/>
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}">
<StackPanel Orientation="Horizontal" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}">
<Path x:Name="PathMain" Width="{TemplateBinding controls:IconElement.Width}" Height="{TemplateBinding controls:IconElement.Height}" Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Data="{TemplateBinding controls:IconElement.Geometry}"/>
<ContentPresenter x:Name="ContentPresenterMain" VerticalAlignment="Center" Margin="6,0,0,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</StackPanel>
</Border>
</controls:SimplePanel>
<ControlTemplate.Triggers>
<Trigger Property="Content" Value="{x:Null}">
<Setter Property="Visibility" Value="Collapsed" TargetName="ContentPresenterMain"/>
</Trigger>
<Trigger Property="controls:IconElement.Geometry" Value="{x:Null}">
<Setter Property="Visibility" Value="Collapsed" TargetName="PathMain"/>
<Setter Property="Margin" Value="0" TargetName="ContentPresenterMain"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Opacity" Value=".9"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Opacity" Value=".6"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.4"/>
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>
@@ -0,0 +1,88 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:HandyControl.Controls">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="Base/RepeatButtonBaseStyle.xaml"/>
</ResourceDictionary.MergedDictionaries>
<Style BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
<Setter Property="BorderThickness" Value="1"/>
<Style.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Background" Value="{DynamicResource DarkDefaultBrush}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Background" Value="{DynamicResource BorderBrush}"/>
</Trigger>
</Style.Triggers>
</Style>
<Style x:Key="RepeatButtonPrimary" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
<Setter Property="Background" Value="{DynamicResource PrimaryBrush}"/>
</Style>
<Style x:Key="RepeatButtonSuccess" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
<Setter Property="Background" Value="{DynamicResource SuccessBrush}"/>
</Style>
<Style x:Key="RepeatButtonInfo" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
<Setter Property="Background" Value="{DynamicResource InfoBrush}"/>
</Style>
<Style x:Key="RepeatButtonWarning" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
<Setter Property="Background" Value="{DynamicResource WarningBrush}"/>
</Style>
<Style x:Key="RepeatButtonDanger" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
<Setter Property="Background" Value="{DynamicResource DangerBrush}"/>
</Style>
<Style x:Key="RepeatButtonIcon" BasedOn="{StaticResource RepeatButtonBaseStyle}" TargetType="RepeatButton">
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="controls:BorderElement.CornerRadius" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RepeatButton">
<Border CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
<ContentControl HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<Path Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Width="{TemplateBinding controls:IconElement.Width}" Height="{TemplateBinding controls:IconElement.Height}" Data="{TemplateBinding controls:IconElement.Geometry}"/>
</ContentControl>
</Border>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style x:Key="RepeatButtonCustom" TargetType="RepeatButton">
<Setter Property="Background" Value="{x:Null}"/>
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
<Setter Property="HorizontalContentAlignment" Value="Center"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="Focusable" Value="False"/>
<Setter Property="IsTabStop" Value="False"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="RepeatButton">
<Border x:Name="Chrome" SnapsToDevicePixels="true" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
<ContentPresenter Margin="{TemplateBinding Padding}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Opacity" Value=".9"/>
<Setter Property="Background" TargetName="Chrome" Value="{Binding Path=(controls:BackgroundSwitchElement.MouseHoverBackground),RelativeSource={RelativeSource TemplatedParent}}"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter Property="Opacity" Value=".6"/>
<Setter Property="Background" TargetName="Chrome" Value="{Binding Path=(controls:BackgroundSwitchElement.MouseDownBackground),RelativeSource={RelativeSource TemplatedParent}}"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter Property="Opacity" Value="0.4"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>