47 files changed
+530
-208
No files matched your search
@@ -53,7 +53,11 @@
|
|||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
<IncludeInVSIX>true</IncludeInVSIX>
|
<IncludeInVSIX>true</IncludeInVSIX>
|
||||||
</Content>
|
</Content>
|
||||||
<Content Include="Packages\handycontrol.1.5.5.nupkg">
|
<Content Include="Packages\handycontrol.2.0.0.nupkg">
|
||||||
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
|
<IncludeInVSIX>true</IncludeInVSIX>
|
||||||
|
</Content>
|
||||||
|
<Content Include="ProjectTemplates\WpfCoreApp.zip">
|
||||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||||
<IncludeInVSIX>true</IncludeInVSIX>
|
<IncludeInVSIX>true</IncludeInVSIX>
|
||||||
</Content>
|
</Content>
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -10,5 +10,5 @@ using System.Runtime.InteropServices;
|
|||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
[assembly: AssemblyVersion("1.5.5")]
|
[assembly: AssemblyVersion("2.0.0")]
|
||||||
[assembly: AssemblyFileVersion("1.5.5")]
|
[assembly: AssemblyFileVersion("2.0.0")]
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" ?>
|
<?xml version="1.0" ?>
|
||||||
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
|
<PackageManifest Version="2.0.0" xmlns="http://schemas.microsoft.com/developer/vsx-schema/2011" xmlns:d="http://schemas.microsoft.com/developer/vsx-schema-design/2011">
|
||||||
<Metadata>
|
<Metadata>
|
||||||
<Identity Id="5949c79d-eb43-4033-8b7b-9349d34512c6" Version="1.5.5" Language="en-US" Publisher="HandyOrg" />
|
<Identity Id="5949c79d-eb43-4033-8b7b-9349d34512c6" Version="2.0.0" Language="en-US" Publisher="HandyOrg" />
|
||||||
<DisplayName>HandyControl for VS2019</DisplayName>
|
<DisplayName>HandyControl for VS2019</DisplayName>
|
||||||
<Description xml:space="preserve">This VSIX Project will help people initialize a HandyControl project.</Description>
|
<Description xml:space="preserve">This VSIX Project will help people initialize a HandyControl project.</Description>
|
||||||
<MoreInfo>https://handyorg.github.io/handycontrol</MoreInfo>
|
<MoreInfo>https://handyorg.github.io/handycontrol</MoreInfo>
|
||||||
@@ -26,5 +26,6 @@
|
|||||||
<Assets>
|
<Assets>
|
||||||
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
|
<Asset Type="Microsoft.VisualStudio.VsPackage" d:Source="Project" d:ProjectName="%CurrentProject%" Path="|%CurrentProject%;PkgdefProjectOutputGroup|" />
|
||||||
<Asset Type="Microsoft.VisualStudio.ProjectTemplate" d:Source="File" Path="ProjectTemplates" d:TargetPath="ProjectTemplates\WpfApp.zip" />
|
<Asset Type="Microsoft.VisualStudio.ProjectTemplate" d:Source="File" Path="ProjectTemplates" d:TargetPath="ProjectTemplates\WpfApp.zip" />
|
||||||
|
<Asset Type="Microsoft.VisualStudio.ProjectTemplate" d:Source="File" Path="ProjectTemplates" d:TargetPath="ProjectTemplates\WpfCoreApp.zip" />
|
||||||
</Assets>
|
</Assets>
|
||||||
</PackageManifest>
|
</PackageManifest>
|
||||||
@@ -1,6 +1,6 @@
|
|||||||

|

|
||||||
|
|
||||||
   [](https://www.nuget.org/packages/HandyControl) [](https://ci.appveyor.com/project/handyorg/handycontrol) [](https://gitter.im/HandyControl/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](//shang.qq.com/wpa/qunwpa?idkey=a571e5553c9d41e49c4f22f3a8b2865451497a795ff281fedf3285def247efc1)
|
   [](https://www.nuget.org/packages/HandyControl) [](https://ci.appveyor.com/project/handyorg/handycontrol) [](https://gitter.im/HandyControl/Lobby?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge) [](//shang.qq.com/wpa/qunwpa?idkey=a571e5553c9d41e49c4f22f3a8b2865451497a795ff281fedf3285def247efc1)
|
||||||
[](https://github.com/ghost1372/HandyControl/wiki)
|
[](https://github.com/ghost1372/HandyControl/wiki)
|
||||||
|
|
||||||
# Welcome to HandyControl
|
# Welcome to HandyControl
|
||||||
@@ -63,6 +63,10 @@ Step 4:enjoy coding
|
|||||||
|
|
||||||
## Latest examples
|
## Latest examples
|
||||||
|
|
||||||
|
### ButtonGroup
|
||||||
|
|
||||||
|

|
||||||
|
|
||||||
### Grid
|
### Grid
|
||||||
|
|
||||||

|

|
||||||
@@ -79,12 +83,12 @@ Step 4:enjoy coding
|
|||||||
|
|
||||||

|

|
||||||
|
|
||||||
|
## History publication
|
||||||
|
|
||||||
### WaveProgressBar
|
### WaveProgressBar
|
||||||
|
|
||||||

|

|
||||||
|
|
||||||
## History publication
|
|
||||||
|
|
||||||
### Badge
|
### Badge
|
||||||
|
|
||||||

|

|
||||||
|
|||||||
Binary file not shown.
|
After Width: | Height: | Size: 19 KiB |
Binary file not shown.
|
Before Width: | Height: | Size: 16 KiB After Width: | Height: | Size: 5.9 KiB |
@@ -4,8 +4,6 @@ title: 欢迎来到HandyOrg
|
|||||||
|
|
||||||
HandyOrg的宗旨是为用户提供最简单的API。
|
HandyOrg的宗旨是为用户提供最简单的API。
|
||||||
|
|
||||||
目前组织成员只有一人。
|
|
||||||
|
|
||||||
我们一直期待着有更多的同学加入。
|
我们一直期待着有更多的同学加入。
|
||||||
|
|
||||||
我们的入坑要求:
|
我们的入坑要求:
|
||||||
|
|||||||
@@ -1,5 +1,42 @@
|
|||||||
---
|
---
|
||||||
title: 建设中
|
title: BackgroundSwitchElement 可切换背景的元素
|
||||||
---
|
---
|
||||||
|
|
||||||
建设中
|
# 准备工作
|
||||||
|
添加`HandyControl`命名空间
|
||||||
|
{% code %}
|
||||||
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|
## MouseHoverBackground `鼠标悬浮背景色`
|
||||||
|
|
||||||
|
该附加属性常用于设置控件在鼠标悬浮时的背景色,在控件的样式或者模板中我们添加如下的触发器代码:
|
||||||
|
|
||||||
|
{% code %}
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="Background" TargetName="Chrome" Value="{Binding Path=(controls:BackgroundSwitchElement.MouseHoverBackground),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||||
|
</Trigger>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|
随后我们就可以使用该属性了:
|
||||||
|
|
||||||
|
{% code %}
|
||||||
|
<目标控件 controls:BackgroundSwitchElement.MouseHoverBackground ="Blue"/>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|
## MouseDownBackground `鼠标按下背景色`
|
||||||
|
|
||||||
|
该附加属性常用于设置控件在鼠标按下时的背景色,在控件的样式或者模板中我们添加如下的触发器代码:
|
||||||
|
|
||||||
|
{% code %}
|
||||||
|
<Trigger Property="IsPressed" Value="True">
|
||||||
|
<Setter Property="Background" TargetName="Chrome"
|
||||||
|
Value="{Binding Path=(controls:BackgroundSwitchElement.MouseHoverBackground),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||||
|
</Trigger>
|
||||||
|
{% endcode %}
|
||||||
|
|
||||||
|
随后我们就可以使用该属性了:
|
||||||
|
|
||||||
|
{% code %}
|
||||||
|
<目标控件 controls:BackgroundSwitchElement.MouseDownBackground ="Yellow"/>
|
||||||
|
{% endcode %}
|
||||||
@@ -4,7 +4,7 @@ title: 鸣谢
|
|||||||
|
|
||||||
# 感谢以下Coder提供代码贡献
|
# 感谢以下Coder提供代码贡献
|
||||||
|
|
||||||
<p><a style="border:0" href="https://github.com/ghost1372" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/9213496?s=400&v=4" alt="ghost1372"></a><a style="border:0" href="https://github.com/DingpingZhang" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/8541016?s=400&v=4" alt="Dingping Zhang"></a><a style="border:0" href="https://github.com/M0n7y5" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/17201053?s=400&v=4" alt="M0n7y5"></a><a style="border:0" href="https://github.com/guanguanchuangyu" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars1.githubusercontent.com/u/25916858?s=400&v=4" alt="guanguanchuangyu"></a><a style="border:0" href="https://github.com/yanchao891012" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/16846702?s=400&v=4" alt="guanguanchuangyu"></a></p>
|
<p><a style="border:0" href="https://github.com/ghost1372" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/9213496?s=400&v=4" alt="ghost1372"></a><a style="border:0" href="https://github.com/DingpingZhang" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/8541016?s=400&v=4" alt="Dingping Zhang"></a><a style="border:0" href="https://github.com/M0n7y5" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/17201053?s=400&v=4" alt="M0n7y5"></a><a style="border:0" href="https://github.com/guanguanchuangyu" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars1.githubusercontent.com/u/25916858?s=400&v=4" alt="guanguanchuangyu"></a><a style="border:0" href="https://github.com/yanchao891012" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars0.githubusercontent.com/u/16846702?s=400&v=4" alt="yanchao891012"></a><a style="border:0" href="https://github.com/noctwolf" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars3.githubusercontent.com/u/21022467?s=400&v=4" alt="noctwolf"></a></p>
|
||||||
|
|
||||||
# 感谢以下User提供使用建议
|
# 感谢以下User提供使用建议
|
||||||
|
|
||||||
|
|||||||
@@ -5,10 +5,12 @@
|
|||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
<AssemblyName>HandyControlDemo</AssemblyName>
|
<AssemblyName>HandyControlDemo</AssemblyName>
|
||||||
<RootNamespace>HandyControlDemo</RootNamespace>
|
<RootNamespace>HandyControlDemo</RootNamespace>
|
||||||
<Version>1.5.5</Version>
|
<Version>2.0.0</Version>
|
||||||
<ApplicationIcon>..\..\Shared\HandyControlDemo_Shared\Resources\Img\icon.ico</ApplicationIcon>
|
<ApplicationIcon>..\..\Shared\HandyControlDemo_Shared\Resources\Img\icon.ico</ApplicationIcon>
|
||||||
<Configurations>Debug;Release</Configurations>
|
<Configurations>Debug;Release</Configurations>
|
||||||
<Copyright>Copyright © HandyOrg 2018-2019</Copyright>
|
<Copyright>Copyright © HandyOrg 2018-2019</Copyright>
|
||||||
|
<FileVersion>2.0.0.0</FileVersion>
|
||||||
|
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||||
</PropertyGroup>
|
</PropertyGroup>
|
||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||||
<DefineConstants>TRACE;Core</DefineConstants>
|
<DefineConstants>TRACE;Core</DefineConstants>
|
||||||
@@ -350,6 +352,9 @@
|
|||||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\brackets_Square_16xLG.png">
|
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\brackets_Square_16xLG.png">
|
||||||
<Link>Resources\Img\LeftMainContent\brackets_Square_16xLG.png</Link>
|
<Link>Resources\Img\LeftMainContent\brackets_Square_16xLG.png</Link>
|
||||||
</Resource>
|
</Resource>
|
||||||
|
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ButtonGroup_16x.png">
|
||||||
|
<Link>Resources\Img\LeftMainContent\ButtonGroup_16x.png</Link>
|
||||||
|
</Resource>
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
<EmbeddedResource Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.en.resx">
|
<EmbeddedResource Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.en.resx">
|
||||||
|
|||||||
@@ -4,8 +4,8 @@
|
|||||||
<UseWPF>true</UseWPF>
|
<UseWPF>true</UseWPF>
|
||||||
<AssemblyName>HandyControl</AssemblyName>
|
<AssemblyName>HandyControl</AssemblyName>
|
||||||
<RootNamespace>HandyControl</RootNamespace>
|
<RootNamespace>HandyControl</RootNamespace>
|
||||||
<Version>1.5.5</Version>
|
<Version>2.0.0</Version>
|
||||||
<AssemblyVersion>1.5.5.0</AssemblyVersion>
|
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||||
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
|
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
|
||||||
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
||||||
<Copyright>Copyright © HandyOrg 2018-2019</Copyright>
|
<Copyright>Copyright © HandyOrg 2018-2019</Copyright>
|
||||||
|
|||||||
@@ -395,6 +395,9 @@
|
|||||||
<Generator>TextTemplatingFileGenerator</Generator>
|
<Generator>TextTemplatingFileGenerator</Generator>
|
||||||
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ButtonGroup_16x.png">
|
||||||
|
<Link>Resources\Img\LeftMainContent\ButtonGroup_16x.png</Link>
|
||||||
|
</Resource>
|
||||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\brackets_Square_16xLG.png">
|
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\brackets_Square_16xLG.png">
|
||||||
<Link>Resources\Img\LeftMainContent\brackets_Square_16xLG.png</Link>
|
<Link>Resources\Img\LeftMainContent\brackets_Square_16xLG.png</Link>
|
||||||
</Resource>
|
</Resource>
|
||||||
|
|||||||
@@ -457,6 +457,9 @@
|
|||||||
<Generator>TextTemplatingFileGenerator</Generator>
|
<Generator>TextTemplatingFileGenerator</Generator>
|
||||||
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
||||||
</Content>
|
</Content>
|
||||||
|
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\ButtonGroup_16x.png">
|
||||||
|
<Link>Resources\Img\LeftMainContent\ButtonGroup_16x.png</Link>
|
||||||
|
</Resource>
|
||||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\brackets_Square_16xLG.png">
|
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\brackets_Square_16xLG.png">
|
||||||
<Link>Resources\Img\LeftMainContent\brackets_Square_16xLG.png</Link>
|
<Link>Resources\Img\LeftMainContent\brackets_Square_16xLG.png</Link>
|
||||||
</Resource>
|
</Resource>
|
||||||
|
|||||||
@@ -62,7 +62,7 @@
|
|||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-Net45|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-Net45|AnyCPU' ">
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>bin\Release\Net45\</OutputPath>
|
||||||
<DefineConstants>TRACE;netle45</DefineConstants>
|
<DefineConstants>TRACE;netle45</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
@@ -73,7 +73,7 @@
|
|||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-Net462|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-Net462|AnyCPU' ">
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>bin\Release\Net462\</OutputPath>
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
@@ -84,7 +84,7 @@
|
|||||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-Net47|AnyCPU' ">
|
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-Net47|AnyCPU' ">
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>bin\Release\Net47\</OutputPath>
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
@@ -95,7 +95,7 @@
|
|||||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Net48|AnyCPU'">
|
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Net48|AnyCPU'">
|
||||||
<DebugType>pdbonly</DebugType>
|
<DebugType>pdbonly</DebugType>
|
||||||
<Optimize>true</Optimize>
|
<Optimize>true</Optimize>
|
||||||
<OutputPath>bin\Release\</OutputPath>
|
<OutputPath>bin\Release\Net48\</OutputPath>
|
||||||
<DefineConstants>TRACE</DefineConstants>
|
<DefineConstants>TRACE</DefineConstants>
|
||||||
<ErrorReport>prompt</ErrorReport>
|
<ErrorReport>prompt</ErrorReport>
|
||||||
<WarningLevel>4</WarningLevel>
|
<WarningLevel>4</WarningLevel>
|
||||||
|
|||||||
@@ -98,6 +98,8 @@
|
|||||||
|
|
||||||
public static readonly string RangeSliderDemoCtl = nameof(RangeSliderDemoCtl);
|
public static readonly string RangeSliderDemoCtl = nameof(RangeSliderDemoCtl);
|
||||||
|
|
||||||
|
public static readonly string ButtonGroupDemoCtl = nameof(ButtonGroupDemoCtl);
|
||||||
|
|
||||||
public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
|
public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
|
||||||
|
|
||||||
public static readonly string RepeatButtonDemoCtl = nameof(RepeatButtonDemoCtl);
|
public static readonly string RepeatButtonDemoCtl = nameof(RepeatButtonDemoCtl);
|
||||||
|
|||||||
@@ -51,7 +51,8 @@ var controlList = new List<string>
|
|||||||
"DialogDemoCtl",
|
"DialogDemoCtl",
|
||||||
"SideMenuDemoCtl",
|
"SideMenuDemoCtl",
|
||||||
"GridDemoCtl",
|
"GridDemoCtl",
|
||||||
"RangeSliderDemoCtl"
|
"RangeSliderDemoCtl",
|
||||||
|
"ButtonGroupDemoCtl"
|
||||||
};
|
};
|
||||||
var styleList = new List<string>
|
var styleList = new List<string>
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -56,6 +56,9 @@
|
|||||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\BadgeDemoCtl.xaml.cs">
|
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\BadgeDemoCtl.xaml.cs">
|
||||||
<DependentUpon>BadgeDemoCtl.xaml</DependentUpon>
|
<DependentUpon>BadgeDemoCtl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\ButtonGroupDemoCtl.xaml.cs">
|
||||||
|
<DependentUpon>ButtonGroupDemoCtl.xaml</DependentUpon>
|
||||||
|
</Compile>
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\CalendarWithClockDemoCtl.xaml.cs">
|
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\CalendarWithClockDemoCtl.xaml.cs">
|
||||||
<DependentUpon>CalendarWithClockDemoCtl.xaml</DependentUpon>
|
<DependentUpon>CalendarWithClockDemoCtl.xaml</DependentUpon>
|
||||||
</Compile>
|
</Compile>
|
||||||
@@ -413,6 +416,10 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\ButtonGroupDemoCtl.xaml">
|
||||||
|
<SubType>Designer</SubType>
|
||||||
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
</Page>
|
||||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\CalendarWithClockDemoCtl.xaml">
|
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\CalendarWithClockDemoCtl.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
|
|||||||
@@ -13,5 +13,5 @@ using System.Windows;
|
|||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
|
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
|
||||||
[assembly: AssemblyVersion("1.5.5")]
|
[assembly: AssemblyVersion("2.0.0")]
|
||||||
#endif
|
#endif
|
||||||
@@ -177,6 +177,15 @@ namespace HandyControlDemo.Properties.Langs {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// <summary>
|
||||||
|
/// 查找类似 按钮组 的本地化字符串。
|
||||||
|
/// </summary>
|
||||||
|
public static string ButtonGroup {
|
||||||
|
get {
|
||||||
|
return ResourceManager.GetString("ButtonGroup", resourceCulture);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// <summary>
|
/// <summary>
|
||||||
/// 查找类似 日历 的本地化字符串。
|
/// 查找类似 日历 的本地化字符串。
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
|||||||
@@ -618,4 +618,7 @@
|
|||||||
<data name="Off" xml:space="preserve">
|
<data name="Off" xml:space="preserve">
|
||||||
<value>Off</value>
|
<value>Off</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ButtonGroup" xml:space="preserve">
|
||||||
|
<value>ButtonGroup</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
@@ -618,4 +618,7 @@
|
|||||||
<data name="Off" xml:space="preserve">
|
<data name="Off" xml:space="preserve">
|
||||||
<value>关</value>
|
<value>关</value>
|
||||||
</data>
|
</data>
|
||||||
|
<data name="ButtonGroup" xml:space="preserve">
|
||||||
|
<value>按钮组</value>
|
||||||
|
</data>
|
||||||
</root>
|
</root>
|
||||||
Binary file not shown.
|
After Width: | Height: | Size: 194 B |
@@ -0,0 +1,71 @@
|
|||||||
|
<UserControl x:Class="HandyControlDemo.UserControl.ButtonGroupDemoCtl"
|
||||||
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||||
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
|
Background="{DynamicResource RegionBrush}"
|
||||||
|
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||||
|
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs">
|
||||||
|
<hc:TransitioningContentControl>
|
||||||
|
<WrapPanel Margin="16" VerticalAlignment="Center">
|
||||||
|
<StackPanel Margin="16">
|
||||||
|
<hc:ButtonGroup>
|
||||||
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
||||||
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
|
</hc:ButtonGroup>
|
||||||
|
<hc:ButtonGroup Margin="0,32,0,0">
|
||||||
|
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||||
|
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||||
|
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||||
|
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||||
|
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||||
|
</hc:ButtonGroup>
|
||||||
|
<hc:ButtonGroup Margin="0,32,0,0" Style="{StaticResource ButtonGroupSolid}">
|
||||||
|
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||||
|
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||||
|
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}" IsChecked="True"/>
|
||||||
|
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||||
|
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||||
|
</hc:ButtonGroup>
|
||||||
|
<hc:ButtonGroup Margin="0,32,0,0">
|
||||||
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
||||||
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
|
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||||
|
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||||
|
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}" IsChecked="True"/>
|
||||||
|
</hc:ButtonGroup>
|
||||||
|
</StackPanel>
|
||||||
|
<StackPanel Margin="16" Orientation="Horizontal">
|
||||||
|
<hc:ButtonGroup Orientation="Vertical">
|
||||||
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
||||||
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
|
</hc:ButtonGroup>
|
||||||
|
<hc:ButtonGroup Margin="32,0,0,0" Orientation="Vertical">
|
||||||
|
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||||
|
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||||
|
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||||
|
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||||
|
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||||
|
</hc:ButtonGroup>
|
||||||
|
<hc:ButtonGroup Margin="32,0,0,0" Style="{StaticResource ButtonGroupSolid}" Orientation="Vertical">
|
||||||
|
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||||
|
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||||
|
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}" IsChecked="True"/>
|
||||||
|
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||||
|
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||||
|
</hc:ButtonGroup>
|
||||||
|
<hc:ButtonGroup Margin="32,0,0,0" Orientation="Vertical">
|
||||||
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
||||||
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
|
<Button Content="{x:Static langs:Lang.Button}"/>
|
||||||
|
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}"/>
|
||||||
|
<ToggleButton Content="{x:Static langs:Lang.ToggleButton}" IsChecked="True"/>
|
||||||
|
</hc:ButtonGroup>
|
||||||
|
</StackPanel>
|
||||||
|
</WrapPanel>
|
||||||
|
</hc:TransitioningContentControl>
|
||||||
|
</UserControl>
|
||||||
@@ -0,0 +1,40 @@
|
|||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Media.Imaging;
|
||||||
|
|
||||||
|
namespace HandyControlDemo.UserControl
|
||||||
|
{
|
||||||
|
public partial class ButtonGroupDemoCtl
|
||||||
|
{
|
||||||
|
public ButtonGroupDemoCtl()
|
||||||
|
{
|
||||||
|
InitializeComponent();
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty SourceProperty = DependencyProperty.Register(
|
||||||
|
"Source", typeof(BitmapFrame), typeof(Avatar), new PropertyMetadata(default(BitmapFrame)));
|
||||||
|
|
||||||
|
public BitmapFrame Source
|
||||||
|
{
|
||||||
|
get => (BitmapFrame) GetValue(SourceProperty);
|
||||||
|
set => SetValue(SourceProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty UserNameProperty = DependencyProperty.Register(
|
||||||
|
"DisplayName", typeof(string), typeof(Avatar), new PropertyMetadata(default(string)));
|
||||||
|
|
||||||
|
public string DisplayName
|
||||||
|
{
|
||||||
|
get => (string) GetValue(UserNameProperty);
|
||||||
|
set => SetValue(UserNameProperty, value);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static readonly DependencyProperty LinkProperty = DependencyProperty.Register(
|
||||||
|
"Link", typeof(string), typeof(Avatar), new PropertyMetadata(default(string)));
|
||||||
|
|
||||||
|
public string Link
|
||||||
|
{
|
||||||
|
get => (string) GetValue(LinkProperty);
|
||||||
|
set => SetValue(LinkProperty, value);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -210,6 +210,11 @@
|
|||||||
<Image Source="../../Resources/Img/LeftMainContent/GoToTop_16x.png"/>
|
<Image Source="../../Resources/Img/LeftMainContent/GoToTop_16x.png"/>
|
||||||
</hc:EdgeElement.LeftContent>
|
</hc:EdgeElement.LeftContent>
|
||||||
</ListBoxItem>
|
</ListBoxItem>
|
||||||
|
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.ButtonGroupDemoCtl}" Content="{x:Static langs:Lang.ButtonGroup}">
|
||||||
|
<hc:EdgeElement.LeftContent>
|
||||||
|
<Image Source="../../Resources/Img/LeftMainContent/ButtonGroup_16x.png"/>
|
||||||
|
</hc:EdgeElement.LeftContent>
|
||||||
|
</ListBoxItem>
|
||||||
<ListBoxItem Tag="{x:Static data:MessageToken.ProgressButtonDemoCtl}" Content="{x:Static langs:Lang.ProgressButton}">
|
<ListBoxItem Tag="{x:Static data:MessageToken.ProgressButtonDemoCtl}" Content="{x:Static langs:Lang.ProgressButton}">
|
||||||
<hc:EdgeElement.LeftContent>
|
<hc:EdgeElement.LeftContent>
|
||||||
<Image Source="../../Resources/Img/LeftMainContent/ProgressButton_16x.png"/>
|
<Image Source="../../Resources/Img/LeftMainContent/ProgressButton_16x.png"/>
|
||||||
|
|||||||
@@ -58,31 +58,31 @@
|
|||||||
<RadioButton Margin="10,0,0,0" BorderThickness="1" Style="{StaticResource RadioButtonIcon}" Content="Radio"/>
|
<RadioButton Margin="10,0,0,0" BorderThickness="1" Style="{StaticResource RadioButtonIcon}" Content="Radio"/>
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<hc:RadioGroup Margin="0,32,0,0">
|
<hc:ButtonGroup Margin="0,32,0,0">
|
||||||
<RadioButton Content="Radio" IsChecked="True"/>
|
<RadioButton Content="Radio" IsChecked="True"/>
|
||||||
<RadioButton Content="Radio"/>
|
<RadioButton Content="Radio"/>
|
||||||
<RadioButton IsEnabled="False" Content="Radio"/>
|
<RadioButton IsEnabled="False" Content="Radio"/>
|
||||||
<RadioButton Content="Radio"/>
|
<RadioButton Content="Radio"/>
|
||||||
</hc:RadioGroup>
|
</hc:ButtonGroup>
|
||||||
<hc:RadioGroup Margin="0,16,0,0" Style="{StaticResource RadioGroupSolid}">
|
<hc:ButtonGroup Margin="0,16,0,0" Style="{StaticResource ButtonGroupSolid}">
|
||||||
<RadioButton Content="Radio"/>
|
<RadioButton Content="Radio"/>
|
||||||
<RadioButton Content="Radio"/>
|
<RadioButton Content="Radio"/>
|
||||||
<RadioButton IsEnabled="False" Content="Radio"/>
|
<RadioButton IsEnabled="False" Content="Radio"/>
|
||||||
<RadioButton Content="Radio" IsChecked="True"/>
|
<RadioButton Content="Radio" IsChecked="True"/>
|
||||||
</hc:RadioGroup>
|
</hc:ButtonGroup>
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||||
<hc:RadioGroup Margin="0,16,8,0" Orientation="Vertical">
|
<hc:ButtonGroup Margin="0,16,8,0" Orientation="Vertical">
|
||||||
<RadioButton Content="Radio" IsChecked="True"/>
|
<RadioButton Content="Radio" IsChecked="True"/>
|
||||||
<RadioButton Content="Radio"/>
|
<RadioButton Content="Radio"/>
|
||||||
<RadioButton IsEnabled="False" Content="Radio"/>
|
<RadioButton IsEnabled="False" Content="Radio"/>
|
||||||
<RadioButton Content="Radio"/>
|
<RadioButton Content="Radio"/>
|
||||||
</hc:RadioGroup>
|
</hc:ButtonGroup>
|
||||||
<hc:RadioGroup Margin="8,16,0,0" Orientation="Vertical" Style="{StaticResource RadioGroupSolid}">
|
<hc:ButtonGroup Margin="8,16,0,0" Orientation="Vertical" Style="{StaticResource ButtonGroupSolid}">
|
||||||
<RadioButton Content="Radio"/>
|
<RadioButton Content="Radio"/>
|
||||||
<RadioButton Content="Radio"/>
|
<RadioButton Content="Radio"/>
|
||||||
<RadioButton IsEnabled="False" Content="Radio"/>
|
<RadioButton IsEnabled="False" Content="Radio"/>
|
||||||
<RadioButton Content="Radio" IsChecked="True"/>
|
<RadioButton Content="Radio" IsChecked="True"/>
|
||||||
</hc:RadioGroup>
|
</hc:ButtonGroup>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</Border>
|
</Border>
|
||||||
|
|||||||
@@ -20,31 +20,31 @@
|
|||||||
<RadioButton Margin="10,0,0,0" BorderThickness="1" Style="{StaticResource RadioButtonIcon}" Content="{x:Static langs:Lang.RadioButton}"/>
|
<RadioButton Margin="10,0,0,0" BorderThickness="1" Style="{StaticResource RadioButtonIcon}" Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
</UniformGrid>
|
</UniformGrid>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
<hc:RadioGroup Margin="0,32,0,0">
|
<hc:ButtonGroup Margin="0,32,0,0">
|
||||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
||||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
<RadioButton IsEnabled="False" Content="{x:Static langs:Lang.RadioButton}"/>
|
<RadioButton IsEnabled="False" Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
</hc:RadioGroup>
|
</hc:ButtonGroup>
|
||||||
<hc:RadioGroup Margin="0,16,0,0" Style="{StaticResource RadioGroupSolid}">
|
<hc:ButtonGroup Margin="0,16,0,0" Style="{StaticResource ButtonGroupSolid}">
|
||||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
<RadioButton IsEnabled="False" Content="{x:Static langs:Lang.RadioButton}"/>
|
<RadioButton IsEnabled="False" Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
||||||
</hc:RadioGroup>
|
</hc:ButtonGroup>
|
||||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center">
|
||||||
<hc:RadioGroup Margin="0,16,8,0" Orientation="Vertical">
|
<hc:ButtonGroup Margin="0,16,8,0" Orientation="Vertical">
|
||||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
||||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
<RadioButton IsEnabled="False" Content="{x:Static langs:Lang.RadioButton}"/>
|
<RadioButton IsEnabled="False" Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
</hc:RadioGroup>
|
</hc:ButtonGroup>
|
||||||
<hc:RadioGroup Margin="8,16,0,0" Orientation="Vertical" Style="{StaticResource RadioGroupSolid}">
|
<hc:ButtonGroup Margin="8,16,0,0" Orientation="Vertical" Style="{StaticResource ButtonGroupSolid}">
|
||||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
<RadioButton IsEnabled="False" Content="{x:Static langs:Lang.RadioButton}"/>
|
<RadioButton IsEnabled="False" Content="{x:Static langs:Lang.RadioButton}"/>
|
||||||
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
<RadioButton Content="{x:Static langs:Lang.RadioButton}" IsChecked="True"/>
|
||||||
</hc:RadioGroup>
|
</hc:ButtonGroup>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
</hc:TransitioningContentControl>
|
</hc:TransitioningContentControl>
|
||||||
|
|||||||
@@ -17,8 +17,8 @@
|
|||||||
Width="340"
|
Width="340"
|
||||||
Height="220">
|
Height="220">
|
||||||
<hc:SimplePanel>
|
<hc:SimplePanel>
|
||||||
<TextBlock Text="{x:Static hc:Lang.Cancel}" />
|
<Path Data="{StaticResource LogoGeometry}" Width="40" Height="40" Fill="#f06632" VerticalAlignment="Top" Margin="0,16,0,0"/>
|
||||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,30,0,0">
|
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,64,0,0">
|
||||||
<TextBlock Text="HandyControl" FontSize="30" Foreground="{StaticResource PrimaryBrush}" VerticalAlignment="Top" HorizontalAlignment="Center"/>
|
<TextBlock Text="HandyControl" FontSize="30" Foreground="{StaticResource PrimaryBrush}" VerticalAlignment="Top" HorizontalAlignment="Center"/>
|
||||||
<TextBlock Text="{Binding Version}" HorizontalAlignment="Center" Margin="0,10,0,0" Foreground="{StaticResource PrimaryBrush}"/>
|
<TextBlock Text="{Binding Version}" HorizontalAlignment="Center" Margin="0,10,0,0" Foreground="{StaticResource PrimaryBrush}"/>
|
||||||
</StackPanel>
|
</StackPanel>
|
||||||
|
|||||||
+7
-8
@@ -1,17 +1,16 @@
|
|||||||
using System.Windows;
|
using System.Windows;
|
||||||
using System.Windows.Controls;
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Controls.Primitives;
|
||||||
using HandyControl.Tools;
|
using HandyControl.Tools;
|
||||||
|
|
||||||
namespace HandyControl.Controls
|
namespace HandyControl.Controls
|
||||||
{
|
{
|
||||||
public class RadioGroup : ItemsControl
|
public class ButtonGroup : ItemsControl
|
||||||
{
|
{
|
||||||
protected override DependencyObject GetContainerForItemOverride() => new RadioButton();
|
protected override bool IsItemItsOwnContainerOverride(object item) => item is Button || item is RadioButton || item is ToggleButton;
|
||||||
|
|
||||||
protected override bool IsItemItsOwnContainerOverride(object item) => item is RadioButton;
|
|
||||||
|
|
||||||
public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(
|
||||||
"Orientation", typeof(Orientation), typeof(RadioGroup), new PropertyMetadata(default(Orientation)));
|
"Orientation", typeof(Orientation), typeof(ButtonGroup), new PropertyMetadata(default(Orientation)));
|
||||||
|
|
||||||
public Orientation Orientation
|
public Orientation Orientation
|
||||||
{
|
{
|
||||||
@@ -20,7 +19,7 @@ namespace HandyControl.Controls
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static readonly DependencyProperty ItemStyleSelectorProperty = DependencyProperty.Register(
|
public static readonly DependencyProperty ItemStyleSelectorProperty = DependencyProperty.Register(
|
||||||
"ItemStyleSelector", typeof(StyleSelector), typeof(RadioGroup), new PropertyMetadata(new RadioGroupItemStyleSelector()));
|
"ItemStyleSelector", typeof(StyleSelector), typeof(ButtonGroup), new PropertyMetadata(new ButtonGroupItemStyleSelector()));
|
||||||
|
|
||||||
public StyleSelector ItemStyleSelector
|
public StyleSelector ItemStyleSelector
|
||||||
{
|
{
|
||||||
@@ -35,9 +34,9 @@ namespace HandyControl.Controls
|
|||||||
var count = Items.Count;
|
var count = Items.Count;
|
||||||
for (var i = 0; i < count; i++)
|
for (var i = 0; i < count; i++)
|
||||||
{
|
{
|
||||||
var item = (RadioButton)Items[i];
|
var item = (ButtonBase)Items[i];
|
||||||
item.Style = ItemStyleSelector?.SelectStyle(item, this);
|
item.Style = ItemStyleSelector?.SelectStyle(item, this);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
using System;
|
using System;
|
||||||
using System.ComponentModel;
|
using System.ComponentModel;
|
||||||
|
using System.Diagnostics.CodeAnalysis;
|
||||||
using System.Media;
|
using System.Media;
|
||||||
using System.Text;
|
using System.Text;
|
||||||
using System.Windows;
|
using System.Windows;
|
||||||
@@ -14,6 +15,7 @@ namespace HandyControl.Controls
|
|||||||
/// <summary>
|
/// <summary>
|
||||||
/// 消息框
|
/// 消息框
|
||||||
/// </summary>
|
/// </summary>
|
||||||
|
[SuppressMessage("ReSharper", "RedundantDelegateCreation")]
|
||||||
public sealed class MessageBox : Window
|
public sealed class MessageBox : Window
|
||||||
{
|
{
|
||||||
private MessageBoxResult _messageBoxResult = MessageBoxResult.Cancel;
|
private MessageBoxResult _messageBoxResult = MessageBoxResult.Cancel;
|
||||||
@@ -31,7 +33,7 @@ namespace HandyControl.Controls
|
|||||||
|
|
||||||
public string Message
|
public string Message
|
||||||
{
|
{
|
||||||
get => (string) GetValue(MessageProperty);
|
get => (string)GetValue(MessageProperty);
|
||||||
set => SetValue(MessageProperty, value);
|
set => SetValue(MessageProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -40,7 +42,7 @@ namespace HandyControl.Controls
|
|||||||
|
|
||||||
public Geometry Image
|
public Geometry Image
|
||||||
{
|
{
|
||||||
get => (Geometry) GetValue(ImageProperty);
|
get => (Geometry)GetValue(ImageProperty);
|
||||||
set => SetValue(ImageProperty, value);
|
set => SetValue(ImageProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -49,7 +51,7 @@ namespace HandyControl.Controls
|
|||||||
|
|
||||||
public Brush ImageBrush
|
public Brush ImageBrush
|
||||||
{
|
{
|
||||||
get => (Brush) GetValue(ImageBrushProperty);
|
get => (Brush)GetValue(ImageBrushProperty);
|
||||||
set => SetValue(ImageBrushProperty, value);
|
set => SetValue(ImageBrushProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -58,7 +60,7 @@ namespace HandyControl.Controls
|
|||||||
|
|
||||||
public bool ShowImage
|
public bool ShowImage
|
||||||
{
|
{
|
||||||
get => (bool) GetValue(ShowImageProperty);
|
get => (bool)GetValue(ShowImageProperty);
|
||||||
set => SetValue(ShowImageProperty, value);
|
set => SetValue(ShowImageProperty, value);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -139,18 +141,7 @@ namespace HandyControl.Controls
|
|||||||
public static MessageBoxResult Success(string messageBoxText, string caption = null)
|
public static MessageBoxResult Success(string messageBoxText, string caption = null)
|
||||||
{
|
{
|
||||||
MessageBox messageBox = null;
|
MessageBox messageBox = null;
|
||||||
#if netle40
|
|
||||||
Application.Current.Dispatcher.Invoke(new Action(() =>
|
Application.Current.Dispatcher.Invoke(new Action(() =>
|
||||||
{
|
|
||||||
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.None, MessageBoxResult.OK);
|
|
||||||
SetButtonStatus(messageBox, MessageBoxButton.OK);
|
|
||||||
messageBox.ShowImage = true;
|
|
||||||
messageBox.Image = ResourceHelper.GetResource<Geometry>(ResourceToken.SuccessGeometry);
|
|
||||||
messageBox.ImageBrush = ResourceHelper.GetResource<Brush>(ResourceToken.SuccessBrush);
|
|
||||||
messageBox.ShowDialog();
|
|
||||||
}));
|
|
||||||
#else
|
|
||||||
Application.Current.Dispatcher.Invoke(() =>
|
|
||||||
{
|
{
|
||||||
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.None, MessageBoxResult.OK);
|
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.None, MessageBoxResult.OK);
|
||||||
SetButtonStatus(messageBox, MessageBoxButton.OK);
|
SetButtonStatus(messageBox, MessageBoxButton.OK);
|
||||||
@@ -159,8 +150,7 @@ namespace HandyControl.Controls
|
|||||||
messageBox.ImageBrush = ResourceHelper.GetResource<Brush>(ResourceToken.SuccessBrush);
|
messageBox.ImageBrush = ResourceHelper.GetResource<Brush>(ResourceToken.SuccessBrush);
|
||||||
SystemSounds.Asterisk.Play();
|
SystemSounds.Asterisk.Play();
|
||||||
messageBox.ShowDialog();
|
messageBox.ShowDialog();
|
||||||
});
|
}));
|
||||||
#endif
|
|
||||||
|
|
||||||
return messageBox._messageBoxResult;
|
return messageBox._messageBoxResult;
|
||||||
}
|
}
|
||||||
@@ -173,24 +163,14 @@ namespace HandyControl.Controls
|
|||||||
public static MessageBoxResult Info(string messageBoxText, string caption = null)
|
public static MessageBoxResult Info(string messageBoxText, string caption = null)
|
||||||
{
|
{
|
||||||
MessageBox messageBox = null;
|
MessageBox messageBox = null;
|
||||||
#if netle40
|
|
||||||
Application.Current.Dispatcher.Invoke(new Action(() =>
|
Application.Current.Dispatcher.Invoke(new Action(() =>
|
||||||
{
|
|
||||||
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
|
|
||||||
SetButtonStatus(messageBox, MessageBoxButton.OK);
|
|
||||||
SetImage(messageBox, MessageBoxImage.Information);
|
|
||||||
messageBox.ShowDialog();
|
|
||||||
}));
|
|
||||||
#else
|
|
||||||
Application.Current.Dispatcher.Invoke(() =>
|
|
||||||
{
|
{
|
||||||
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
|
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.Information, MessageBoxResult.OK);
|
||||||
SetButtonStatus(messageBox, MessageBoxButton.OK);
|
SetButtonStatus(messageBox, MessageBoxButton.OK);
|
||||||
SetImage(messageBox, MessageBoxImage.Information);
|
SetImage(messageBox, MessageBoxImage.Information);
|
||||||
SystemSounds.Asterisk.Play();
|
SystemSounds.Asterisk.Play();
|
||||||
messageBox.ShowDialog();
|
messageBox.ShowDialog();
|
||||||
});
|
}));
|
||||||
#endif
|
|
||||||
|
|
||||||
return messageBox._messageBoxResult;
|
return messageBox._messageBoxResult;
|
||||||
}
|
}
|
||||||
@@ -203,24 +183,14 @@ namespace HandyControl.Controls
|
|||||||
public static MessageBoxResult Warning(string messageBoxText, string caption = null)
|
public static MessageBoxResult Warning(string messageBoxText, string caption = null)
|
||||||
{
|
{
|
||||||
MessageBox messageBox = null;
|
MessageBox messageBox = null;
|
||||||
#if netle40
|
|
||||||
Application.Current.Dispatcher.Invoke(new Action(() =>
|
Application.Current.Dispatcher.Invoke(new Action(() =>
|
||||||
{
|
|
||||||
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.Warning, MessageBoxResult.OK);
|
|
||||||
SetButtonStatus(messageBox, MessageBoxButton.OK);
|
|
||||||
SetImage(messageBox, MessageBoxImage.Warning);
|
|
||||||
messageBox.ShowDialog();
|
|
||||||
}));
|
|
||||||
#else
|
|
||||||
Application.Current.Dispatcher.Invoke(() =>
|
|
||||||
{
|
{
|
||||||
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.Warning, MessageBoxResult.OK);
|
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.Warning, MessageBoxResult.OK);
|
||||||
SetButtonStatus(messageBox, MessageBoxButton.OK);
|
SetButtonStatus(messageBox, MessageBoxButton.OK);
|
||||||
SetImage(messageBox, MessageBoxImage.Warning);
|
SetImage(messageBox, MessageBoxImage.Warning);
|
||||||
SystemSounds.Asterisk.Play();
|
SystemSounds.Asterisk.Play();
|
||||||
messageBox.ShowDialog();
|
messageBox.ShowDialog();
|
||||||
});
|
}));
|
||||||
#endif
|
|
||||||
|
|
||||||
return messageBox._messageBoxResult;
|
return messageBox._messageBoxResult;
|
||||||
}
|
}
|
||||||
@@ -233,24 +203,14 @@ namespace HandyControl.Controls
|
|||||||
public static MessageBoxResult Error(string messageBoxText, string caption = null)
|
public static MessageBoxResult Error(string messageBoxText, string caption = null)
|
||||||
{
|
{
|
||||||
MessageBox messageBox = null;
|
MessageBox messageBox = null;
|
||||||
#if netle40
|
|
||||||
Application.Current.Dispatcher.Invoke(new Action(() =>
|
Application.Current.Dispatcher.Invoke(new Action(() =>
|
||||||
{
|
|
||||||
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
|
|
||||||
SetButtonStatus(messageBox, MessageBoxButton.OK);
|
|
||||||
SetImage(messageBox, MessageBoxImage.Error);
|
|
||||||
messageBox.ShowDialog();
|
|
||||||
}));
|
|
||||||
#else
|
|
||||||
Application.Current.Dispatcher.Invoke(() =>
|
|
||||||
{
|
{
|
||||||
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
|
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.Error, MessageBoxResult.OK);
|
||||||
SetButtonStatus(messageBox, MessageBoxButton.OK);
|
SetButtonStatus(messageBox, MessageBoxButton.OK);
|
||||||
SetImage(messageBox, MessageBoxImage.Error);
|
SetImage(messageBox, MessageBoxImage.Error);
|
||||||
SystemSounds.Asterisk.Play();
|
SystemSounds.Asterisk.Play();
|
||||||
messageBox.ShowDialog();
|
messageBox.ShowDialog();
|
||||||
});
|
}));
|
||||||
#endif
|
|
||||||
|
|
||||||
return messageBox._messageBoxResult;
|
return messageBox._messageBoxResult;
|
||||||
}
|
}
|
||||||
@@ -263,18 +223,7 @@ namespace HandyControl.Controls
|
|||||||
public static MessageBoxResult Fatal(string messageBoxText, string caption = null)
|
public static MessageBoxResult Fatal(string messageBoxText, string caption = null)
|
||||||
{
|
{
|
||||||
MessageBox messageBox = null;
|
MessageBox messageBox = null;
|
||||||
#if netle40
|
|
||||||
Application.Current.Dispatcher.Invoke(new Action(() =>
|
Application.Current.Dispatcher.Invoke(new Action(() =>
|
||||||
{
|
|
||||||
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.None, MessageBoxResult.OK);
|
|
||||||
SetButtonStatus(messageBox, MessageBoxButton.OK);
|
|
||||||
messageBox.ShowImage = true;
|
|
||||||
messageBox.Image = ResourceHelper.GetResource<Geometry>(ResourceToken.FatalGeometry);
|
|
||||||
messageBox.ImageBrush = ResourceHelper.GetResource<Brush>(ResourceToken.PrimaryTextBrush);
|
|
||||||
messageBox.ShowDialog();
|
|
||||||
}));
|
|
||||||
#else
|
|
||||||
Application.Current.Dispatcher.Invoke(() =>
|
|
||||||
{
|
{
|
||||||
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.None, MessageBoxResult.OK);
|
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OK, MessageBoxImage.None, MessageBoxResult.OK);
|
||||||
SetButtonStatus(messageBox, MessageBoxButton.OK);
|
SetButtonStatus(messageBox, MessageBoxButton.OK);
|
||||||
@@ -283,8 +232,7 @@ namespace HandyControl.Controls
|
|||||||
messageBox.ImageBrush = ResourceHelper.GetResource<Brush>(ResourceToken.PrimaryTextBrush);
|
messageBox.ImageBrush = ResourceHelper.GetResource<Brush>(ResourceToken.PrimaryTextBrush);
|
||||||
SystemSounds.Asterisk.Play();
|
SystemSounds.Asterisk.Play();
|
||||||
messageBox.ShowDialog();
|
messageBox.ShowDialog();
|
||||||
});
|
}));
|
||||||
#endif
|
|
||||||
|
|
||||||
return messageBox._messageBoxResult;
|
return messageBox._messageBoxResult;
|
||||||
}
|
}
|
||||||
@@ -297,24 +245,14 @@ namespace HandyControl.Controls
|
|||||||
public static MessageBoxResult Ask(string messageBoxText, string caption = null)
|
public static MessageBoxResult Ask(string messageBoxText, string caption = null)
|
||||||
{
|
{
|
||||||
MessageBox messageBox = null;
|
MessageBox messageBox = null;
|
||||||
#if netle40
|
|
||||||
Application.Current.Dispatcher.Invoke(new Action(() =>
|
Application.Current.Dispatcher.Invoke(new Action(() =>
|
||||||
{
|
|
||||||
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OKCancel, MessageBoxImage.Question, MessageBoxResult.Cancel);
|
|
||||||
SetButtonStatus(messageBox, MessageBoxButton.OKCancel);
|
|
||||||
SetImage(messageBox, MessageBoxImage.Question);
|
|
||||||
messageBox.ShowDialog();
|
|
||||||
}));
|
|
||||||
#else
|
|
||||||
Application.Current.Dispatcher.Invoke(() =>
|
|
||||||
{
|
{
|
||||||
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OKCancel, MessageBoxImage.Question, MessageBoxResult.Cancel);
|
messageBox = CreateMessageBox(null, messageBoxText, caption, MessageBoxButton.OKCancel, MessageBoxImage.Question, MessageBoxResult.Cancel);
|
||||||
SetButtonStatus(messageBox, MessageBoxButton.OKCancel);
|
SetButtonStatus(messageBox, MessageBoxButton.OKCancel);
|
||||||
SetImage(messageBox, MessageBoxImage.Question);
|
SetImage(messageBox, MessageBoxImage.Question);
|
||||||
SystemSounds.Asterisk.Play();
|
SystemSounds.Asterisk.Play();
|
||||||
messageBox.ShowDialog();
|
messageBox.ShowDialog();
|
||||||
});
|
}));
|
||||||
#endif
|
|
||||||
|
|
||||||
return messageBox._messageBoxResult;
|
return messageBox._messageBoxResult;
|
||||||
}
|
}
|
||||||
@@ -327,7 +265,6 @@ namespace HandyControl.Controls
|
|||||||
public static MessageBoxResult Show(MessageBoxInfo info)
|
public static MessageBoxResult Show(MessageBoxInfo info)
|
||||||
{
|
{
|
||||||
MessageBox messageBox = null;
|
MessageBox messageBox = null;
|
||||||
#if netle40
|
|
||||||
Application.Current.Dispatcher.Invoke(new Action(() =>
|
Application.Current.Dispatcher.Invoke(new Action(() =>
|
||||||
{
|
{
|
||||||
messageBox = CreateMessageBox(null, info.MessageBoxText, info.Caption, info.Button, MessageBoxImage.None, info.DefaultResult);
|
messageBox = CreateMessageBox(null, info.MessageBoxText, info.Caption, info.Button, MessageBoxImage.None, info.DefaultResult);
|
||||||
@@ -340,33 +277,13 @@ namespace HandyControl.Controls
|
|||||||
messageBox.ImageBrush = ResourceHelper.GetResource<Brush>(info.IconBrushKey);
|
messageBox.ImageBrush = ResourceHelper.GetResource<Brush>(info.IconBrushKey);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (info.Style != null)
|
|
||||||
{
|
|
||||||
messageBox.Style = info.Style;
|
|
||||||
}
|
|
||||||
messageBox.ShowDialog();
|
|
||||||
}));
|
|
||||||
#else
|
|
||||||
Application.Current.Dispatcher.Invoke(() =>
|
|
||||||
{
|
|
||||||
messageBox = CreateMessageBox(null, info.MessageBoxText, info.Caption, info.Button, MessageBoxImage.None, info.DefaultResult);
|
|
||||||
SetButtonStatus(messageBox, info.Button);
|
|
||||||
|
|
||||||
if (!string.IsNullOrEmpty(info.IconKey))
|
|
||||||
{
|
|
||||||
messageBox.ShowImage = true;
|
|
||||||
messageBox.Image = ResourceHelper.GetResource<Geometry>(info.IconKey);
|
|
||||||
messageBox.ImageBrush = ResourceHelper.GetResource<Brush>(info.IconBrushKey);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (info.Style != null)
|
if (info.Style != null)
|
||||||
{
|
{
|
||||||
messageBox.Style = info.Style;
|
messageBox.Style = info.Style;
|
||||||
}
|
}
|
||||||
SystemSounds.Asterisk.Play();
|
SystemSounds.Asterisk.Play();
|
||||||
messageBox.ShowDialog();
|
messageBox.ShowDialog();
|
||||||
});
|
}));
|
||||||
#endif
|
|
||||||
|
|
||||||
return messageBox._messageBoxResult;
|
return messageBox._messageBoxResult;
|
||||||
}
|
}
|
||||||
@@ -398,24 +315,14 @@ namespace HandyControl.Controls
|
|||||||
public static MessageBoxResult Show(System.Windows.Window owner, string messageBoxText, string caption = null, MessageBoxButton button = MessageBoxButton.OK, MessageBoxImage icon = MessageBoxImage.None, MessageBoxResult defaultResult = MessageBoxResult.None)
|
public static MessageBoxResult Show(System.Windows.Window owner, string messageBoxText, string caption = null, MessageBoxButton button = MessageBoxButton.OK, MessageBoxImage icon = MessageBoxImage.None, MessageBoxResult defaultResult = MessageBoxResult.None)
|
||||||
{
|
{
|
||||||
MessageBox messageBox = null;
|
MessageBox messageBox = null;
|
||||||
#if netle40
|
|
||||||
Application.Current.Dispatcher.Invoke(new Action(() =>
|
Application.Current.Dispatcher.Invoke(new Action(() =>
|
||||||
{
|
|
||||||
messageBox = CreateMessageBox(owner, messageBoxText, caption, button, icon, defaultResult);
|
|
||||||
SetButtonStatus(messageBox, button);
|
|
||||||
SetImage(messageBox, icon);
|
|
||||||
messageBox.ShowDialog();
|
|
||||||
}));
|
|
||||||
#else
|
|
||||||
Application.Current.Dispatcher.Invoke(() =>
|
|
||||||
{
|
{
|
||||||
messageBox = CreateMessageBox(owner, messageBoxText, caption, button, icon, defaultResult);
|
messageBox = CreateMessageBox(owner, messageBoxText, caption, button, icon, defaultResult);
|
||||||
SetButtonStatus(messageBox, button);
|
SetButtonStatus(messageBox, button);
|
||||||
SetImage(messageBox, icon);
|
SetImage(messageBox, icon);
|
||||||
SystemSounds.Asterisk.Play();
|
SystemSounds.Asterisk.Play();
|
||||||
messageBox.ShowDialog();
|
messageBox.ShowDialog();
|
||||||
});
|
}));
|
||||||
#endif
|
|
||||||
|
|
||||||
return messageBox._messageBoxResult;
|
return messageBox._messageBoxResult;
|
||||||
}
|
}
|
||||||
@@ -540,4 +447,4 @@ namespace HandyControl.Controls
|
|||||||
|| value == MessageBoxResult.Yes;
|
|| value == MessageBoxResult.Yes;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -52,6 +52,30 @@
|
|||||||
|
|
||||||
internal const string RadioGroupItemVerticalLast = nameof(RadioGroupItemVerticalLast);
|
internal const string RadioGroupItemVerticalLast = nameof(RadioGroupItemVerticalLast);
|
||||||
|
|
||||||
|
internal const string ButtonGroupItemDefault = nameof(ButtonGroupItemDefault);
|
||||||
|
|
||||||
|
internal const string ButtonGroupItemSingle = nameof(ButtonGroupItemSingle);
|
||||||
|
|
||||||
|
internal const string ButtonGroupItemHorizontalFirst = nameof(ButtonGroupItemHorizontalFirst);
|
||||||
|
|
||||||
|
internal const string ButtonGroupItemHorizontalLast = nameof(ButtonGroupItemHorizontalLast);
|
||||||
|
|
||||||
|
internal const string ButtonGroupItemVerticalFirst = nameof(ButtonGroupItemVerticalFirst);
|
||||||
|
|
||||||
|
internal const string ButtonGroupItemVerticalLast = nameof(ButtonGroupItemVerticalLast);
|
||||||
|
|
||||||
|
internal const string ToggleButtonGroupItemDefault = nameof(ToggleButtonGroupItemDefault);
|
||||||
|
|
||||||
|
internal const string ToggleButtonGroupItemSingle = nameof(ToggleButtonGroupItemSingle);
|
||||||
|
|
||||||
|
internal const string ToggleButtonGroupItemHorizontalFirst = nameof(ToggleButtonGroupItemHorizontalFirst);
|
||||||
|
|
||||||
|
internal const string ToggleButtonGroupItemHorizontalLast = nameof(ToggleButtonGroupItemHorizontalLast);
|
||||||
|
|
||||||
|
internal const string ToggleButtonGroupItemVerticalFirst = nameof(ToggleButtonGroupItemVerticalFirst);
|
||||||
|
|
||||||
|
internal const string ToggleButtonGroupItemVerticalLast = nameof(ToggleButtonGroupItemVerticalLast);
|
||||||
|
|
||||||
internal const string TabItemCapsuleDefault = nameof(TabItemCapsuleDefault);
|
internal const string TabItemCapsuleDefault = nameof(TabItemCapsuleDefault);
|
||||||
|
|
||||||
internal const string TabItemCapsuleSingle = nameof(TabItemCapsuleSingle);
|
internal const string TabItemCapsuleSingle = nameof(TabItemCapsuleSingle);
|
||||||
|
|||||||
@@ -18,6 +18,7 @@
|
|||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\InfoElement.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\InfoElement.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\PanelElement.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\PanelElement.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\PasswordBoxAttach.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Attach\PasswordBoxAttach.cs" />
|
||||||
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\ButtonGroup.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Slider\RangeSlider\RangeTrack.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Slider\RangeSlider\RangeTrack.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Slider\RangeSlider\RangeThumb.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Slider\RangeSlider\RangeThumb.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Slider\RangeSlider\TwoWayRangeBase.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Slider\RangeSlider\TwoWayRangeBase.cs" />
|
||||||
@@ -77,7 +78,6 @@
|
|||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Growl.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Growl.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\NotifyIcon.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\NotifyIcon.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Pagination.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Pagination.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\RadioGroup.cs" />
|
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\ScrollViewer.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\ScrollViewer.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Shield.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Shield.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\TransitioningContentControl.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\TransitioningContentControl.cs" />
|
||||||
@@ -278,7 +278,7 @@
|
|||||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\Queue\Deque!1.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Tools\Queue\Deque!1.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\RegularJudgment.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Tools\RegularJudgment.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\RegularPatterns.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Tools\RegularPatterns.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\StyleSelector\RadioGroupItemStyleSelector.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Tools\StyleSelector\ButtonGroupItemStyleSelector.cs" />
|
||||||
<Compile Include="$(MSBuildThisFileDirectory)Tools\StyleSelector\TabItemCapsuleStyleSelector.cs" />
|
<Compile Include="$(MSBuildThisFileDirectory)Tools\StyleSelector\TabItemCapsuleStyleSelector.cs" />
|
||||||
</ItemGroup>
|
</ItemGroup>
|
||||||
<ItemGroup>
|
<ItemGroup>
|
||||||
@@ -466,7 +466,7 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\Base\RadioGroupBaseStyle.xaml">
|
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\Base\ButtonGroupBaseStyle.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
@@ -662,7 +662,7 @@
|
|||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\RadioGroup.xaml">
|
<Page Include="$(MSBuildThisFileDirectory)Themes\Styles\ButtonGroup.xaml">
|
||||||
<SubType>Designer</SubType>
|
<SubType>Designer</SubType>
|
||||||
<Generator>MSBuild:Compile</Generator>
|
<Generator>MSBuild:Compile</Generator>
|
||||||
</Page>
|
</Page>
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ using System.Runtime.InteropServices;
|
|||||||
[assembly: AssemblyTrademark("")]
|
[assembly: AssemblyTrademark("")]
|
||||||
[assembly: AssemblyCulture("")]
|
[assembly: AssemblyCulture("")]
|
||||||
[assembly: ComVisible(false)]
|
[assembly: ComVisible(false)]
|
||||||
[assembly: AssemblyVersion("1.5.5")]
|
[assembly: AssemblyVersion("2.0.0")]
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
[assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Controls")]
|
[assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Controls")]
|
||||||
|
|||||||
@@ -46,4 +46,45 @@
|
|||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="ButtonGroupItemBaseStyle" BasedOn="{StaticResource BaseStyle}" TargetType="Button">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||||
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||||
|
<Setter Property="controls:BorderElement.CornerRadius" Value="0"/>
|
||||||
|
<Setter Property="Height" Value="{StaticResource DefaultControlHeight}"/>
|
||||||
|
<Setter Property="Padding" Value="10,0"/>
|
||||||
|
<Setter Property="Margin" Value="-1,0,0,0"/>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="Button">
|
||||||
|
<Border x:Name="BorderRoot" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
|
||||||
|
<ContentPresenter x:Name="contentPresenter" TextElement.Foreground="{TemplateBinding Foreground}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="TextElement.Foreground" Value="{DynamicResource PrimaryBrush}" TargetName="contentPresenter"/>
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsEnabled" Value="False">
|
||||||
|
<Setter Property="Opacity" Value="0.4"/>
|
||||||
|
</Trigger>
|
||||||
|
<DataTrigger Binding="{Binding Orientation,RelativeSource={RelativeSource AncestorType=controls:ButtonGroup}}" Value="Vertical">
|
||||||
|
<Setter Property="Margin" Value="0,-1,0,0"/>
|
||||||
|
</DataTrigger>
|
||||||
|
<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>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
+6
-5
@@ -2,24 +2,25 @@
|
|||||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:controls="clr-namespace:HandyControl.Controls">
|
xmlns:controls="clr-namespace:HandyControl.Controls">
|
||||||
|
|
||||||
<ItemsPanelTemplate x:Key="RadioGroupHorizontalItemsPanelTemplate">
|
<ItemsPanelTemplate x:Key="ButtonGroupHorizontalItemsPanelTemplate">
|
||||||
<UniformGrid FocusVisualStyle="{x:Null}" Rows="1"/>
|
<UniformGrid FocusVisualStyle="{x:Null}" Rows="1"/>
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
|
|
||||||
<ItemsPanelTemplate x:Key="RadioGroupVerticalItemsPanelTemplate">
|
<ItemsPanelTemplate x:Key="ButtonGroupVerticalItemsPanelTemplate">
|
||||||
<UniformGrid FocusVisualStyle="{x:Null}" Columns="1"/>
|
<UniformGrid FocusVisualStyle="{x:Null}" Columns="1"/>
|
||||||
</ItemsPanelTemplate>
|
</ItemsPanelTemplate>
|
||||||
|
|
||||||
<Style x:Key="RadioGroupBaseStyle" TargetType="controls:RadioGroup">
|
<Style x:Key="ButtonGroupBaseStyle" TargetType="controls:ButtonGroup">
|
||||||
|
<Setter Property="VerticalAlignment" Value="Top"/>
|
||||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||||
<Setter Property="Focusable" Value="False"/>
|
<Setter Property="Focusable" Value="False"/>
|
||||||
<Setter Property="ItemsPanel" Value="{StaticResource RadioGroupHorizontalItemsPanelTemplate}"/>
|
<Setter Property="ItemsPanel" Value="{StaticResource ButtonGroupHorizontalItemsPanelTemplate}"/>
|
||||||
<Setter Property="controls:TitleElement.BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
|
<Setter Property="controls:TitleElement.BorderBrush" Value="{DynamicResource PrimaryBrush}"/>
|
||||||
<Setter Property="controls:TitleElement.Background" Value="{DynamicResource RegionBrush}"/>
|
<Setter Property="controls:TitleElement.Background" Value="{DynamicResource RegionBrush}"/>
|
||||||
<Setter Property="controls:TitleElement.Foreground" Value="{DynamicResource PrimaryBrush}"/>
|
<Setter Property="controls:TitleElement.Foreground" Value="{DynamicResource PrimaryBrush}"/>
|
||||||
<Style.Triggers>
|
<Style.Triggers>
|
||||||
<Trigger Property="Orientation" Value="Vertical">
|
<Trigger Property="Orientation" Value="Vertical">
|
||||||
<Setter Property="ItemsPanel" Value="{StaticResource RadioGroupVerticalItemsPanelTemplate}"/>
|
<Setter Property="ItemsPanel" Value="{StaticResource ButtonGroupVerticalItemsPanelTemplate}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
@@ -196,9 +196,15 @@
|
|||||||
<Trigger Property="IsChecked" Value="True">
|
<Trigger Property="IsChecked" Value="True">
|
||||||
<Setter Property="Panel.ZIndex" Value="{x:Static system:Int32.MaxValue}"/>
|
<Setter Property="Panel.ZIndex" Value="{x:Static system:Int32.MaxValue}"/>
|
||||||
</Trigger>
|
</Trigger>
|
||||||
<DataTrigger Binding="{Binding Orientation,RelativeSource={RelativeSource AncestorType=controls:RadioGroup}}" Value="Vertical">
|
<DataTrigger Binding="{Binding Orientation,RelativeSource={RelativeSource AncestorType=controls:ButtonGroup}}" Value="Vertical">
|
||||||
<Setter Property="Margin" Value="0,-1,0,0"/>
|
<Setter Property="Margin" Value="0,-1,0,0"/>
|
||||||
</DataTrigger>
|
</DataTrigger>
|
||||||
|
<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.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
<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:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||||
xmlns:controls="clr-namespace:HandyControl.Controls">
|
xmlns:controls="clr-namespace:HandyControl.Controls"
|
||||||
|
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||||
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceDictionary Source="ButtonBaseBaseStyle.xaml"/>
|
<ResourceDictionary Source="ButtonBaseBaseStyle.xaml"/>
|
||||||
@@ -218,4 +219,53 @@
|
|||||||
</Style.Triggers>
|
</Style.Triggers>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="ToggleButtonGroupItemBaseStyle" BasedOn="{StaticResource BaseStyle}" TargetType="ToggleButton">
|
||||||
|
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||||
|
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||||
|
<Setter Property="BorderThickness" Value="1"/>
|
||||||
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
||||||
|
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||||
|
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||||
|
<Setter Property="controls:BorderElement.CornerRadius" Value="0"/>
|
||||||
|
<Setter Property="Height" Value="{StaticResource DefaultControlHeight}"/>
|
||||||
|
<Setter Property="Padding" Value="10,0"/>
|
||||||
|
<Setter Property="Margin" Value="-1,0,0,0"/>
|
||||||
|
<Setter Property="Template">
|
||||||
|
<Setter.Value>
|
||||||
|
<ControlTemplate TargetType="ToggleButton">
|
||||||
|
<Border x:Name="BorderRoot" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
|
||||||
|
<ContentPresenter x:Name="contentPresenter" TextElement.Foreground="{TemplateBinding Foreground}" Focusable="False" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" Margin="{TemplateBinding Padding}" RecognizesAccessKey="True" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
|
||||||
|
</Border>
|
||||||
|
<ControlTemplate.Triggers>
|
||||||
|
<Trigger Property="IsMouseOver" Value="True">
|
||||||
|
<Setter Property="TextElement.Foreground" Value="{DynamicResource PrimaryBrush}" TargetName="contentPresenter"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsChecked" Value="true">
|
||||||
|
<Setter Property="BorderBrush" Value="{Binding Path=(controls:TitleElement.BorderBrush),RelativeSource={RelativeSource TemplatedParent}}" TargetName="BorderRoot"/>
|
||||||
|
<Setter Property="Background" Value="{Binding Path=(controls:TitleElement.Background),RelativeSource={RelativeSource TemplatedParent}}" TargetName="BorderRoot"/>
|
||||||
|
<Setter Property="TextElement.Foreground" Value="{Binding Path=(controls:TitleElement.Foreground),RelativeSource={RelativeSource TemplatedParent}}" TargetName="contentPresenter"/>
|
||||||
|
</Trigger>
|
||||||
|
</ControlTemplate.Triggers>
|
||||||
|
</ControlTemplate>
|
||||||
|
</Setter.Value>
|
||||||
|
</Setter>
|
||||||
|
<Style.Triggers>
|
||||||
|
<Trigger Property="IsEnabled" Value="False">
|
||||||
|
<Setter Property="Opacity" Value="0.4"/>
|
||||||
|
</Trigger>
|
||||||
|
<Trigger Property="IsChecked" Value="True">
|
||||||
|
<Setter Property="Panel.ZIndex" Value="{x:Static system:Int32.MaxValue}"/>
|
||||||
|
</Trigger>
|
||||||
|
<DataTrigger Binding="{Binding Orientation,RelativeSource={RelativeSource AncestorType=controls:ButtonGroup}}" Value="Vertical">
|
||||||
|
<Setter Property="Margin" Value="0,-1,0,0"/>
|
||||||
|
</DataTrigger>
|
||||||
|
<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>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -81,4 +81,28 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="ButtonGroupItemDefault" BasedOn="{StaticResource ButtonGroupItemBaseStyle}" TargetType="Button"/>
|
||||||
|
|
||||||
|
<Style x:Key="ButtonGroupItemHorizontalFirst" BasedOn="{StaticResource ButtonGroupItemBaseStyle}" TargetType="Button">
|
||||||
|
<Setter Property="controls:BorderElement.CornerRadius" Value="4,0,0,4"/>
|
||||||
|
<Setter Property="Margin" Value="0"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="ButtonGroupItemHorizontalLast" BasedOn="{StaticResource ButtonGroupItemBaseStyle}" TargetType="Button">
|
||||||
|
<Setter Property="controls:BorderElement.CornerRadius" Value="0,4,4,0"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="ButtonGroupItemSingle" BasedOn="{StaticResource ButtonGroupItemBaseStyle}" TargetType="Button">
|
||||||
|
<Setter Property="controls:BorderElement.CornerRadius" Value="4"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="ButtonGroupItemVerticalFirst" BasedOn="{StaticResource ButtonGroupItemBaseStyle}" TargetType="Button">
|
||||||
|
<Setter Property="controls:BorderElement.CornerRadius" Value="4,4,0,0"/>
|
||||||
|
<Setter Property="Margin" Value="0"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="ButtonGroupItemVerticalLast" BasedOn="{StaticResource ButtonGroupItemBaseStyle}" TargetType="Button">
|
||||||
|
<Setter Property="controls:BorderElement.CornerRadius" Value="0,0,4,4"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
+3
-3
@@ -3,12 +3,12 @@
|
|||||||
xmlns:controls="clr-namespace:HandyControl.Controls">
|
xmlns:controls="clr-namespace:HandyControl.Controls">
|
||||||
|
|
||||||
<ResourceDictionary.MergedDictionaries>
|
<ResourceDictionary.MergedDictionaries>
|
||||||
<ResourceDictionary Source="Base/RadioGroupBaseStyle.xaml"/>
|
<ResourceDictionary Source="Base/ButtonGroupBaseStyle.xaml"/>
|
||||||
</ResourceDictionary.MergedDictionaries>
|
</ResourceDictionary.MergedDictionaries>
|
||||||
|
|
||||||
<Style BasedOn="{StaticResource RadioGroupBaseStyle}" TargetType="controls:RadioGroup"/>
|
<Style BasedOn="{StaticResource ButtonGroupBaseStyle}" TargetType="controls:ButtonGroup"/>
|
||||||
|
|
||||||
<Style x:Key="RadioGroupSolid" BasedOn="{StaticResource RadioGroupBaseStyle}" TargetType="controls:RadioGroup">
|
<Style x:Key="ButtonGroupSolid" BasedOn="{StaticResource ButtonGroupBaseStyle}" TargetType="controls:ButtonGroup">
|
||||||
<Setter Property="controls:TitleElement.BorderBrush" Value="{DynamicResource TitleBrush}"/>
|
<Setter Property="controls:TitleElement.BorderBrush" Value="{DynamicResource TitleBrush}"/>
|
||||||
<Setter Property="controls:TitleElement.Background" Value="{DynamicResource TitleBrush}"/>
|
<Setter Property="controls:TitleElement.Background" Value="{DynamicResource TitleBrush}"/>
|
||||||
<Setter Property="controls:TitleElement.Foreground" Value="{DynamicResource TextIconBrush}"/>
|
<Setter Property="controls:TitleElement.Foreground" Value="{DynamicResource TextIconBrush}"/>
|
||||||
@@ -49,7 +49,7 @@
|
|||||||
<ResourceDictionary Source="ToolBar.xaml"/>
|
<ResourceDictionary Source="ToolBar.xaml"/>
|
||||||
<ResourceDictionary Source="SearchBar.xaml"/>
|
<ResourceDictionary Source="SearchBar.xaml"/>
|
||||||
<ResourceDictionary Source="Tag.xaml"/>
|
<ResourceDictionary Source="Tag.xaml"/>
|
||||||
<ResourceDictionary Source="RadioGroup.xaml"/>
|
<ResourceDictionary Source="ButtonGroup.xaml"/>
|
||||||
<ResourceDictionary Source="FlipClock.xaml"/>
|
<ResourceDictionary Source="FlipClock.xaml"/>
|
||||||
<ResourceDictionary Source="Rate.xaml"/>
|
<ResourceDictionary Source="Rate.xaml"/>
|
||||||
<ResourceDictionary Source="Shield.xaml"/>
|
<ResourceDictionary Source="Shield.xaml"/>
|
||||||
|
|||||||
@@ -264,4 +264,28 @@
|
|||||||
</Setter>
|
</Setter>
|
||||||
</Style>
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="ToggleButtonGroupItemDefault" BasedOn="{StaticResource ToggleButtonGroupItemBaseStyle}" TargetType="ToggleButton"/>
|
||||||
|
|
||||||
|
<Style x:Key="ToggleButtonGroupItemHorizontalFirst" BasedOn="{StaticResource ToggleButtonGroupItemBaseStyle}" TargetType="ToggleButton">
|
||||||
|
<Setter Property="controls:BorderElement.CornerRadius" Value="4,0,0,4"/>
|
||||||
|
<Setter Property="Margin" Value="0"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="ToggleButtonGroupItemHorizontalLast" BasedOn="{StaticResource ToggleButtonGroupItemBaseStyle}" TargetType="ToggleButton">
|
||||||
|
<Setter Property="controls:BorderElement.CornerRadius" Value="0,4,4,0"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="ToggleButtonGroupItemSingle" BasedOn="{StaticResource ToggleButtonGroupItemBaseStyle}" TargetType="ToggleButton">
|
||||||
|
<Setter Property="controls:BorderElement.CornerRadius" Value="4"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="ToggleButtonGroupItemVerticalFirst" BasedOn="{StaticResource ToggleButtonGroupItemBaseStyle}" TargetType="ToggleButton">
|
||||||
|
<Setter Property="controls:BorderElement.CornerRadius" Value="4,4,0,0"/>
|
||||||
|
<Setter Property="Margin" Value="0"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
|
<Style x:Key="ToggleButtonGroupItemVerticalLast" BasedOn="{StaticResource ToggleButtonGroupItemBaseStyle}" TargetType="ToggleButton">
|
||||||
|
<Setter Property="controls:BorderElement.CornerRadius" Value="0,0,4,4"/>
|
||||||
|
</Style>
|
||||||
|
|
||||||
</ResourceDictionary>
|
</ResourceDictionary>
|
||||||
@@ -0,0 +1,87 @@
|
|||||||
|
using System.Windows;
|
||||||
|
using System.Windows.Controls;
|
||||||
|
using System.Windows.Controls.Primitives;
|
||||||
|
using HandyControl.Controls;
|
||||||
|
using HandyControl.Data;
|
||||||
|
|
||||||
|
namespace HandyControl.Tools
|
||||||
|
{
|
||||||
|
public class ButtonGroupItemStyleSelector : StyleSelector
|
||||||
|
{
|
||||||
|
public override Style SelectStyle(object item, DependencyObject container)
|
||||||
|
{
|
||||||
|
if (container is ButtonGroup buttonGroup && item is ButtonBase buttonBase)
|
||||||
|
{
|
||||||
|
var count = buttonGroup.Items.Count;
|
||||||
|
|
||||||
|
switch (buttonBase)
|
||||||
|
{
|
||||||
|
case RadioButton _:
|
||||||
|
{
|
||||||
|
if (count == 1)
|
||||||
|
{
|
||||||
|
return ResourceHelper.GetResource<Style>(ResourceToken.RadioGroupItemSingle);
|
||||||
|
}
|
||||||
|
|
||||||
|
var index = buttonGroup.Items.IndexOf(buttonBase);
|
||||||
|
return buttonGroup.Orientation == Orientation.Horizontal
|
||||||
|
? index == 0
|
||||||
|
? ResourceHelper.GetResource<Style>(ResourceToken.RadioGroupItemHorizontalFirst)
|
||||||
|
: ResourceHelper.GetResource<Style>(index == count - 1
|
||||||
|
? ResourceToken.RadioGroupItemHorizontalLast
|
||||||
|
: ResourceToken.RadioGroupItemDefault)
|
||||||
|
: index == 0
|
||||||
|
? ResourceHelper.GetResource<Style>(ResourceToken.RadioGroupItemVerticalFirst)
|
||||||
|
: ResourceHelper.GetResource<Style>(index == count - 1
|
||||||
|
? ResourceToken.RadioGroupItemVerticalLast
|
||||||
|
: ResourceToken.RadioGroupItemDefault);
|
||||||
|
}
|
||||||
|
|
||||||
|
case Button _:
|
||||||
|
{
|
||||||
|
if (count == 1)
|
||||||
|
{
|
||||||
|
return ResourceHelper.GetResource<Style>(ResourceToken.ButtonGroupItemSingle);
|
||||||
|
}
|
||||||
|
|
||||||
|
var index = buttonGroup.Items.IndexOf(buttonBase);
|
||||||
|
return buttonGroup.Orientation == Orientation.Horizontal
|
||||||
|
? index == 0
|
||||||
|
? ResourceHelper.GetResource<Style>(ResourceToken.ButtonGroupItemHorizontalFirst)
|
||||||
|
: ResourceHelper.GetResource<Style>(index == count - 1
|
||||||
|
? ResourceToken.ButtonGroupItemHorizontalLast
|
||||||
|
: ResourceToken.ButtonGroupItemDefault)
|
||||||
|
: index == 0
|
||||||
|
? ResourceHelper.GetResource<Style>(ResourceToken.ButtonGroupItemVerticalFirst)
|
||||||
|
: ResourceHelper.GetResource<Style>(index == count - 1
|
||||||
|
? ResourceToken.ButtonGroupItemVerticalLast
|
||||||
|
: ResourceToken.ButtonGroupItemDefault);
|
||||||
|
}
|
||||||
|
|
||||||
|
case ToggleButton _:
|
||||||
|
{
|
||||||
|
if (count == 1)
|
||||||
|
{
|
||||||
|
return ResourceHelper.GetResource<Style>(ResourceToken.ToggleButtonGroupItemSingle);
|
||||||
|
}
|
||||||
|
|
||||||
|
var index = buttonGroup.Items.IndexOf(buttonBase);
|
||||||
|
return buttonGroup.Orientation == Orientation.Horizontal
|
||||||
|
? index == 0
|
||||||
|
? ResourceHelper.GetResource<Style>(ResourceToken.ToggleButtonGroupItemHorizontalFirst)
|
||||||
|
: ResourceHelper.GetResource<Style>(index == count - 1
|
||||||
|
? ResourceToken.ToggleButtonGroupItemHorizontalLast
|
||||||
|
: ResourceToken.ToggleButtonGroupItemDefault)
|
||||||
|
: index == 0
|
||||||
|
? ResourceHelper.GetResource<Style>(ResourceToken.ToggleButtonGroupItemVerticalFirst)
|
||||||
|
: ResourceHelper.GetResource<Style>(index == count - 1
|
||||||
|
? ResourceToken.ToggleButtonGroupItemVerticalLast
|
||||||
|
: ResourceToken.ToggleButtonGroupItemDefault);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,37 +0,0 @@
|
|||||||
using System.Windows;
|
|
||||||
using System.Windows.Controls;
|
|
||||||
using HandyControl.Controls;
|
|
||||||
using HandyControl.Data;
|
|
||||||
|
|
||||||
namespace HandyControl.Tools
|
|
||||||
{
|
|
||||||
public class RadioGroupItemStyleSelector : StyleSelector
|
|
||||||
{
|
|
||||||
public override Style SelectStyle(object item, DependencyObject container)
|
|
||||||
{
|
|
||||||
if (container is RadioGroup radioGroup && item is UIElement radioButton)
|
|
||||||
{
|
|
||||||
var count = radioGroup.Items.Count;
|
|
||||||
if (count == 1)
|
|
||||||
{
|
|
||||||
return ResourceHelper.GetResource<Style>(ResourceToken.RadioGroupItemSingle);
|
|
||||||
}
|
|
||||||
|
|
||||||
var index = radioGroup.Items.IndexOf(radioButton);
|
|
||||||
return radioGroup.Orientation == Orientation.Horizontal
|
|
||||||
? index == 0
|
|
||||||
? ResourceHelper.GetResource<Style>(ResourceToken.RadioGroupItemHorizontalFirst)
|
|
||||||
: ResourceHelper.GetResource<Style>(index == count - 1
|
|
||||||
? ResourceToken.RadioGroupItemHorizontalLast
|
|
||||||
: ResourceToken.RadioGroupItemDefault)
|
|
||||||
: index == 0
|
|
||||||
? ResourceHelper.GetResource<Style>(ResourceToken.RadioGroupItemVerticalFirst)
|
|
||||||
: ResourceHelper.GetResource<Style>(index == count - 1
|
|
||||||
? ResourceToken.RadioGroupItemVerticalLast
|
|
||||||
: ResourceToken.RadioGroupItemDefault);
|
|
||||||
}
|
|
||||||
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Reference in new issue
Block a user