Merge branch 'master' into pr/84
No files matched your search
@@ -1,20 +1,5 @@
|
||||
DockBoxResearch/bin
|
||||
DockBoxResearch/obj
|
||||
src/.vs
|
||||
src/Core_30/HandyControl_Core_30/bin
|
||||
src/Core_30/HandyControl_Core_30/obj
|
||||
src/Core_30/HandyControlDemo_Core_30/bin
|
||||
src/Core_30/HandyControlDemo_Core_30/obj
|
||||
src/Net_35/HandyControl_Net_35/bin
|
||||
src/Net_35/HandyControl_Net_35/obj
|
||||
src/Net_35/HandyControlDemo_Net_35/bin
|
||||
src/Net_35/HandyControlDemo_Net_35/obj
|
||||
src/Net_40/HandyControl_Net_40/bin
|
||||
src/Net_40/HandyControl_Net_40/obj
|
||||
src/Net_40/HandyControlDemo_Net_40/bin
|
||||
src/Net_40/HandyControlDemo_Net_40/obj
|
||||
src/Net_GE45/HandyControl_Net_GE45/bin
|
||||
src/Net_GE45/HandyControl_Net_GE45/obj
|
||||
src/Net_GE45/HandyControlDemo_Net_GE45/bin
|
||||
src/Net_GE45/HandyControlDemo_Net_GE45/obj
|
||||
*.user
|
||||
.vs
|
||||
*.user
|
||||
*.xml
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
@@ -0,0 +1,25 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.28803.352
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandyControl_VS2019", "HandyControl_VS2019\HandyControl_VS2019.csproj", "{3F0F7B9E-C150-4FAA-9274-4F6F0A96B8CA}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|Any CPU = Debug|Any CPU
|
||||
Release|Any CPU = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{3F0F7B9E-C150-4FAA-9274-4F6F0A96B8CA}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{3F0F7B9E-C150-4FAA-9274-4F6F0A96B8CA}.Debug|Any CPU.Build.0 = Debug|Any CPU
|
||||
{3F0F7B9E-C150-4FAA-9274-4F6F0A96B8CA}.Release|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{3F0F7B9E-C150-4FAA-9274-4F6F0A96B8CA}.Release|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {A7F567D2-5FA3-4E17-A8A8-CDAFC217BFF5}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -0,0 +1,99 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="15.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<MinimumVisualStudioVersion>16.0</MinimumVisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectTypeGuids>{82b43b9b-a64c-4715-b499-d71e9ca2bd60};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<ProjectGuid>{3F0F7B9E-C150-4FAA-9274-4F6F0A96B8CA}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>HandyControl_VS2019</RootNamespace>
|
||||
<AssemblyName>HandyControl_VS2019</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.7.2</TargetFrameworkVersion>
|
||||
<GeneratePkgDefFile>true</GeneratePkgDefFile>
|
||||
<UseCodebase>true</UseCodebase>
|
||||
<IncludeAssemblyInVSIXContainer>true</IncludeAssemblyInVSIXContainer>
|
||||
<IncludeDebugSymbolsInVSIXContainer>false</IncludeDebugSymbolsInVSIXContainer>
|
||||
<IncludeDebugSymbolsInLocalVSIXDeployment>false</IncludeDebugSymbolsInLocalVSIXDeployment>
|
||||
<CopyBuildOutputToOutputDirectory>true</CopyBuildOutputToOutputDirectory>
|
||||
<CopyOutputSymbolsToOutputDirectory>true</CopyOutputSymbolsToOutputDirectory>
|
||||
<StartAction>Program</StartAction>
|
||||
<StartProgram Condition="'$(DevEnvDir)' != ''">$(DevEnvDir)devenv.exe</StartProgram>
|
||||
<StartArguments>/rootsuffix Exp</StartArguments>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="HandyControl_VS2019Package.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="ProjectTemplates\WpfApp.zip">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<IncludeInVSIX>true</IncludeInVSIX>
|
||||
</Content>
|
||||
<Content Include="Packages\handycontrol.2.0.0.nupkg">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<IncludeInVSIX>true</IncludeInVSIX>
|
||||
</Content>
|
||||
<Content Include="ProjectTemplates\WpfCoreApp.zip">
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
<IncludeInVSIX>true</IncludeInVSIX>
|
||||
</Content>
|
||||
<None Include="source.extension.vsixmanifest">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<PackageReference Include="Microsoft.VisualStudio.SDK" Version="15.9.3" ExcludeAssets="runtime" />
|
||||
<PackageReference Include="Microsoft.VSSDK.BuildTools" Version="16.0.2268" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="icon_100_100.png">
|
||||
<IncludeInVSIX>true</IncludeInVSIX>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="icon_300_300.png">
|
||||
<IncludeInVSIX>true</IncludeInVSIX>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="License.txt">
|
||||
<IncludeInVSIX>true</IncludeInVSIX>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(VSToolsPath)\VSSDK\Microsoft.VsSDK.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
<Target Name="BeforeBuild">
|
||||
</Target>
|
||||
<Target Name="AfterBuild">
|
||||
</Target>
|
||||
-->
|
||||
</Project>
|
||||
@@ -0,0 +1,53 @@
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
using Microsoft.VisualStudio.Shell;
|
||||
using Task = System.Threading.Tasks.Task;
|
||||
|
||||
namespace HandyControl_VS2019
|
||||
{
|
||||
/// <summary>
|
||||
/// This is the class that implements the package exposed by this assembly.
|
||||
/// </summary>
|
||||
/// <remarks>
|
||||
/// <para>
|
||||
/// The minimum requirement for a class to be considered a valid package for Visual Studio
|
||||
/// is to implement the IVsPackage interface and register itself with the shell.
|
||||
/// This package uses the helper classes defined inside the Managed Package Framework (MPF)
|
||||
/// to do it: it derives from the Package class that provides the implementation of the
|
||||
/// IVsPackage interface and uses the registration attributes defined in the framework to
|
||||
/// register itself and its components with the shell. These attributes tell the pkgdef creation
|
||||
/// utility what data to put into .pkgdef file.
|
||||
/// </para>
|
||||
/// <para>
|
||||
/// To get loaded into VS, the package must be referred by <Asset Type="Microsoft.VisualStudio.VsPackage" ...> in .vsixmanifest file.
|
||||
/// </para>
|
||||
/// </remarks>
|
||||
[PackageRegistration(UseManagedResourcesOnly = true, AllowsBackgroundLoading = true)]
|
||||
[Guid(PackageGuidString)]
|
||||
public sealed class HandyControl_VS2019Package : AsyncPackage
|
||||
{
|
||||
/// <summary>
|
||||
/// HandyControl_VS2019Package GUID string.
|
||||
/// </summary>
|
||||
public const string PackageGuidString = "157ef242-83b5-47d0-8f2f-e21dc8308151";
|
||||
|
||||
#region Package Members
|
||||
|
||||
/// <summary>
|
||||
/// Initialization of the package; this method is called right after the package is sited, so this is the place
|
||||
/// where you can put all the initialization code that rely on services provided by VisualStudio.
|
||||
/// </summary>
|
||||
/// <param name="cancellationToken">A cancellation token to monitor for initialization cancellation, which can occur when VS is shutting down.</param>
|
||||
/// <param name="progress">A provider for progress updates.</param>
|
||||
/// <returns>A task representing the async work of package initialization, or an already completed task if there is none. Do not return null from this method.</returns>
|
||||
protected override async Task InitializeAsync(CancellationToken cancellationToken, IProgress<ServiceProgressData> progress)
|
||||
{
|
||||
// When initialized asynchronously, the current thread may be a background thread at this point.
|
||||
// Do any initialization that requires the UI thread after switching to the UI thread.
|
||||
await this.JoinableTaskFactory.SwitchToMainThreadAsync(cancellationToken);
|
||||
}
|
||||
|
||||
#endregion
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,21 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018-2019 HandyOrg
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
@@ -0,0 +1,14 @@
|
||||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[assembly: AssemblyTitle("HandyControl_VS2019")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("HandyControl_VS2019")]
|
||||
[assembly: AssemblyCopyright("")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: AssemblyVersion("2.0.0")]
|
||||
[assembly: AssemblyFileVersion("2.0.0")]
|
||||
|
After Width: | Height: | Size: 5.0 KiB |
|
After Width: | Height: | Size: 13 KiB |
@@ -0,0 +1,31 @@
|
||||
<?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">
|
||||
<Metadata>
|
||||
<Identity Id="5949c79d-eb43-4033-8b7b-9349d34512c6" Version="2.0.0" Language="en-US" Publisher="HandyOrg" />
|
||||
<DisplayName>HandyControl for VS2019</DisplayName>
|
||||
<Description xml:space="preserve">This VSIX Project will help people initialize a HandyControl project.</Description>
|
||||
<MoreInfo>https://handyorg.github.io/handycontrol</MoreInfo>
|
||||
<License>License.txt</License>
|
||||
<GettingStartedGuide>https://handyorg.github.io/handycontrol/quick_start</GettingStartedGuide>
|
||||
<ReleaseNotes>https://github.com/HandyOrg/HandyControl/releases</ReleaseNotes>
|
||||
<Icon>icon_100_100.png</Icon>
|
||||
<PreviewImage>icon_300_300.png</PreviewImage>
|
||||
<Tags>WPF C# Control</Tags>
|
||||
</Metadata>
|
||||
<Installation>
|
||||
<InstallationTarget Id="Microsoft.VisualStudio.Community" Version="[16.0, 17.0)" />
|
||||
<InstallationTarget Id="Microsoft.VisualStudio.Enterprise" Version="[16.0, 17.0)" />
|
||||
<InstallationTarget Id="Microsoft.VisualStudio.Pro" Version="[16.0, 17.0)" />
|
||||
</Installation>
|
||||
<Dependencies>
|
||||
<Dependency Id="Microsoft.Framework.NDP" DisplayName="Microsoft .NET Framework" d:Source="Manual" Version="[4.0,)" />
|
||||
</Dependencies>
|
||||
<Prerequisites>
|
||||
<Prerequisite Id="Microsoft.Net.ComponentGroup.TargetingPacks.Common" Version="[16.0.28516.191,17.0)" DisplayName=".NET Framework 4 – 4.6 开发工具" />
|
||||
</Prerequisites>
|
||||
<Assets>
|
||||
<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\WpfCoreApp.zip" />
|
||||
</Assets>
|
||||
</PackageManifest>
|
||||
@@ -1,6 +1,6 @@
|
||||
MIT License
|
||||
|
||||
Copyright (c) 2018 HandyOrg
|
||||
Copyright (c) 2018-2019 HandyOrg
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
|
||||
@@ -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)
|
||||
|
||||
# Welcome to HandyControl
|
||||
@@ -44,7 +44,16 @@ Step 2:Add code in App.xaml as follows:
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
```
|
||||
Step 3:enjoy coding
|
||||
|
||||
Step 3: Add NameSpace:
|
||||
`xmlns:hc="https://handyorg.github.io/handycontrol"`
|
||||
|
||||
Step 4:enjoy coding
|
||||
|
||||
## VSIX packages for Visual Studio
|
||||
|
||||
| [VS2019](https://marketplace.visualstudio.com/items?itemName=HandyOrg.handycontrolforvs2019) |
|
||||
| ------------- |
|
||||
|
||||
## Overview
|
||||
|
||||
|
||||
@@ -4,4 +4,5 @@ db.json
|
||||
*.log
|
||||
node_modules/
|
||||
public/
|
||||
.deploy*/
|
||||
.deploy*/
|
||||
.vs
|
||||
@@ -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 %}
|
||||
|
After Width: | Height: | Size: 11 KiB |
@@ -1,5 +1,9 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: 附加属性
|
||||
---
|
||||
|
||||
建设中
|
||||
附加属性源码在Controls / Attach文件夹中:
|
||||
|
||||

|
||||
|
||||
以`Element`结尾的类,可以为所有的控件设置一些共有的属性,以`Attach`结尾的类,只能为一种控件设置相关的属性。
|
||||
@@ -1,5 +0,0 @@
|
||||
---
|
||||
title: 建设中
|
||||
---
|
||||
|
||||
建设中
|
||||
@@ -14,5 +14,5 @@ title: 行为
|
||||
| BehaviorY400 | 流体移动行为,y轴运动,400毫秒结束动画 |
|
||||
|
||||
{% note info no-icon %}
|
||||
用例:`controls:PanelElement.FluidMoveBehavior="{StaticResource BehaviorXY200}"`
|
||||
用例:`hc:PanelElement.FluidMoveBehavior="{StaticResource BehaviorXY200}"`
|
||||
{% endnote %}
|
||||
@@ -50,6 +50,10 @@ title: 转换器
|
||||
|
||||
如果该转换器获取到的值为`null`则返回`false`,否则返回`true`。
|
||||
|
||||
# Object2VisibilityConverter
|
||||
|
||||
如果该转换器获取到的值为`null`则返回`Collapsed`,否则返回`Visible`。
|
||||
|
||||
# String2VisibilityConverter
|
||||
|
||||
该转换器接受一个字符串,如果该字符串为空或者为null,则返回`Collapse`,否则返回`Visible`。
|
||||
|
||||
|
Before Width: | Height: | Size: 6.2 KiB After Width: | Height: | Size: 6.3 KiB |
|
Before Width: | Height: | Size: 4.7 KiB After Width: | Height: | Size: 4.7 KiB |
@@ -4,12 +4,15 @@ title: 欢迎使用HandyControl
|
||||
|
||||
HandyControl是一套WPF控件库,它几乎重写了所有原生样式,同时包含50多款额外的控件(正逐步增加)。
|
||||
|
||||
# 使用要求
|
||||
# 要求
|
||||
|
||||
- .Net >= 4.0
|
||||
- OS >= win7
|
||||
- IDE >= vs2017
|
||||
- C# >= 7.0
|
||||
- 使用要求
|
||||
.Net >= 4.0
|
||||
OS >= win7
|
||||
|
||||
- 编译要求
|
||||
IDE >= vs2019
|
||||
C# >= 7.3
|
||||
|
||||
# 下载
|
||||
|
||||
@@ -28,7 +31,7 @@ Github上一般每天都有更新,相对而言不适合用于生产。
|
||||
{% endnote %}
|
||||
|
||||
{% note warning %}
|
||||
文档的更新速度必然跟不上最新的Github源码,有出入的地方一切以本文档为准,因为文档是相对稳定的。
|
||||
文档的更新速度必然跟不上最新的Github源码,有出入的地方一切以Github上Demo示例为准。
|
||||
{% endnote %}
|
||||
|
||||
# 项目结构介绍
|
||||
@@ -38,7 +41,7 @@ Github上一般每天都有更新,相对而言不适合用于生产。
|
||||
从Github上克隆好源码后,进入src文件夹,该文件夹结构如下:
|
||||

|
||||
|
||||
这里一共有三个解决方案sln文件,需要注意的是HandyControl_Core30.sln需要用VS2019打开,其它两个用VS2017即可。
|
||||
这里一共有4个解决方案sln文件。
|
||||
|
||||
`Net_GE45`的意思是.Net版本大于等于4.5
|
||||
|
||||
@@ -83,6 +86,6 @@ Controls中的每个控件一般都能在Themes中找到对应的xaml定义。
|
||||
{% endnote %}
|
||||
|
||||
{% note info %}
|
||||
HandyControl_Net_GE45.sln解决方案中包含了3个项目类型,分别是.Net 4.5、.Net 4.6.2和.Net 4.7,请在解决方案配置下拉框中进行选择:
|
||||
打开HandyControl.sln,在解决方案配置下拉框中选择指定的环境进行编译:
|
||||

|
||||
{% endnote %}
|
||||
|
After Width: | Height: | Size: 2.5 KiB |
@@ -1,5 +1,30 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: 国际化
|
||||
---
|
||||
|
||||
建设中
|
||||
# 使用方式
|
||||
|
||||
可通过`ConfigHelper.Instance.SetLang(string lang)`指定需要使用的语言包,默认使用zh-cn。
|
||||
|
||||
控件库自带的语言包一般为控件库内部使用,但用户也可以通过以下两种方式使用:
|
||||
|
||||
- xaml
|
||||
第一步,引入命名空间:`xmlns:hc="https://handyorg.github.io/handycontrol"`
|
||||
第二步,使用语言包:`<TextBlock Text="{x:Static hc:Lang.Cancel}"/>`
|
||||
|
||||
- C#
|
||||
`HandyControl.Properties.Langs.Lang.Cancel`
|
||||
|
||||
{% note warning %}
|
||||
控件库不支持动态语言包切换,未来也不会有支持。
|
||||
{% endnote %}
|
||||
|
||||
# 扩展
|
||||
|
||||
控件库自带zh-cn和en两份语言包,默认为zh-cn:
|
||||
|
||||

|
||||
|
||||
如果需要可自行扩展,这里推荐使用开源插件:[ResXManager](https://marketplace.visualstudio.com/items?itemName=TomEnglert.ResXManager),来维护所有的语言包。
|
||||
|
||||
引用控件库后,会在运行目录生成语言包文件夹,其命名方式形如zh-cn、en等。
|
||||
@@ -4,16 +4,40 @@ title: ComboBox 组合框
|
||||
|
||||
# ComboBoxBaseStyle
|
||||
|
||||
原生组合框默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
|
||||
原生组合框默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。原生组合框如果未设置任何样式,则默认使用该样式:
|
||||
|
||||
- 默认样式
|
||||
`<ComboBox ItemsSource="{Binding DataList}" SelectedIndex="0"/>`
|
||||

|
||||
|
||||
# ComboBoxExtendBaseStyle : ComboBoxBaseStyle
|
||||
|
||||
原生组合框扩展默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
|
||||
|
||||
# ComboBoxPlusBaseStyle : ComboBoxExtendBaseStyle
|
||||
|
||||
扩展组合框默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
|
||||
|
||||
# ComboBoxExtend : ComboBoxExtendBaseStyle
|
||||
|
||||
相对于原生组合框默认样式,它借助于附加属性可以实现标题、水印的功能。
|
||||
相对于原生组合框默认样式,它借助于附加属性可以实现标题、水印的功能。
|
||||
|
||||
- 标题在上
|
||||
`<ComboBox ItemsSource="{Binding DataList}" SelectedIndex="0" hc:InfoElement.Title="这是标题" Style="{StaticResource ComboBoxExtend}" Text="正文1"/>`
|
||||

|
||||
|
||||
- 标题在左
|
||||
`<ComboBox ItemsSource="{Binding DataList}" Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.TitleAlignment="Left" hc:InfoElement.Title="标题在左侧" Style="{StaticResource ComboBoxExtend}" Text="正文1"/>`
|
||||

|
||||
|
||||
{% note warning %}
|
||||
标题在左时,为了多个输入框左侧对齐,需要设置标题宽度,标题宽度无需逐个设置,可在外部容器上统一设置。
|
||||
{% endnote %}
|
||||
|
||||
- 标题在上,带有水印
|
||||
`<ComboBox ItemsSource="{Binding DataList}" hc:InfoElement.Placeholder="请输入内容" hc:InfoElement.Title="此项必填" Style="{StaticResource ComboBoxExtend}"/>`
|
||||

|
||||
|
||||
- 标题在上,带有水印,且为必填
|
||||
`<ComboBox ItemsSource="{Binding DataList}" hc:InfoElement.Placeholder="请输入内容" hc:InfoElement.Title="此项必填" Style="{StaticResource ComboBoxExtend}" hc:InfoElement.Necessary="True"/>`
|
||||

|
||||
|
||||
- 标题在上,带有水印,且为必填,同时自定义必填提示符
|
||||
`<ComboBox ItemsSource="{Binding DataList}" hc:InfoElement.Placeholder="请输入内容" hc:InfoElement.Title="此项必填" Style="{StaticResource ComboBoxExtend}" hc:InfoElement.Necessary="True" hc:InfoElement.Symbol="*"/>`
|
||||

|
||||
@@ -1,5 +1,5 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: ContentControl 内容控件
|
||||
---
|
||||
|
||||
建设中
|
||||
所有的`ContentControl`默认无法获得焦点
|
||||
@@ -1,5 +1,22 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: ContextMenu 上下文菜单
|
||||
---
|
||||
|
||||
建设中
|
||||
# ContextMenuBaseStyle
|
||||
|
||||
上下文菜单默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
|
||||
|
||||
{% note info no-icon %}
|
||||
用例:
|
||||
|
||||
{% code %}
|
||||
<ContextMenu ItemsSource="{Binding DataList}">
|
||||
<ContextMenu.ItemTemplate>
|
||||
<HierarchicalDataTemplate ItemsSource="{Binding DataList}">
|
||||
<TextBlock Text="{Binding Name}"/>
|
||||
</HierarchicalDataTemplate>
|
||||
</ContextMenu.ItemTemplate>
|
||||
</ContextMenu>
|
||||
{% endcode %}
|
||||

|
||||
{% endnote %}
|
||||
@@ -1,5 +1,32 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: DataGrid 数据表格
|
||||
---
|
||||
|
||||
建设中
|
||||
{% note info no-icon %}
|
||||
用例:
|
||||
|
||||
{% code %}
|
||||
<DataGrid HeadersVisibility="All" RowHeaderWidth="60" AutoGenerateColumns="False" ItemsSource="{Binding DataList}">
|
||||
<DataGrid.RowHeaderTemplate>
|
||||
<DataTemplate>
|
||||
<CheckBox IsChecked="{Binding IsSelected,RelativeSource={RelativeSource AncestorType=DataGridRow}}"/>
|
||||
</DataTemplate>
|
||||
</DataGrid.RowHeaderTemplate>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn IsReadOnly="True" Width="80" CanUserResize="False" Binding="{Binding Index}" Header="{x:Static langs:Lang.Index}"/>
|
||||
<DataGridTemplateColumn Width="60" CanUserResize="False">
|
||||
<DataGridTemplateColumn.CellTemplate>
|
||||
<DataTemplate>
|
||||
<Image Source="{Binding ImgPath}" Width="32" Height="32" Stretch="Uniform"/>
|
||||
</DataTemplate>
|
||||
</DataGridTemplateColumn.CellTemplate>
|
||||
</DataGridTemplateColumn>
|
||||
<DataGridTextColumn Width="1*" Binding="{Binding Name}" Header="{x:Static langs:Lang.Name}"/>
|
||||
<DataGridCheckBoxColumn Width="100" CanUserResize="False" Binding="{Binding IsSelected}" Header="{x:Static langs:Lang.Selected}"/>
|
||||
<DataGridComboBoxColumn ItemsSource="{Binding Source={StaticResource DemoTypes}}" Width="100" CanUserResize="False" SelectedValueBinding="{Binding Type}" Header="{x:Static langs:Lang.Type}"/>
|
||||
<DataGridTextColumn Width="1*" Binding="{Binding Remark}" Header="{x:Static langs:Lang.Remark}"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
{% endcode %}
|
||||

|
||||
{% endnote %}
|
||||
@@ -1,5 +1,38 @@
|
||||
---
|
||||
title: 建设中
|
||||
title: DatePicker 日期选择器
|
||||
---
|
||||
|
||||
建设中
|
||||
# DatePickerBaseStyle
|
||||
|
||||
原生日期选择器默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。原生日期选择器如果未设置任何样式,则默认使用该样式:
|
||||
|
||||
- 默认样式
|
||||
`<DatePicker SelectedDate="{x:Static system:DateTime.Now}"/>`
|
||||

|
||||
|
||||
# DatePickerExtendBaseStyle : DatePickerBaseStyle
|
||||
|
||||
原生日期选择器扩展默认样式,不推荐直接使用,应该始终被其它样式以BasedOn的方式使用。
|
||||
|
||||
# DatePickerExtend : DatePickerExtendBaseStyle
|
||||
|
||||
- 标题在上
|
||||
`<DatePicker SelectedDate="{x:Static system:DateTime.Now}" Style="{StaticResource DatePickerExtend}" hc:InfoElement.Title="这是标题"/>`
|
||||

|
||||
|
||||
- 标题在左
|
||||
`<DatePicker SelectedDate="{x:Static system:DateTime.Now}" Width="380" hc:InfoElement.TitleWidth="140" hc:InfoElement.TitleAlignment="Left" Style="{StaticResource DatePickerExtend}" hc:InfoElement.Title="标题在左侧"/>`
|
||||

|
||||
|
||||
{% note warning %}
|
||||
标题在左时,为了多个输入框左侧对齐,需要设置标题宽度,标题宽度无需逐个设置,可在外部容器上统一设置。
|
||||
{% endnote %}
|
||||
|
||||
- 标题在上,带有水印
|
||||
[参见Combobox](../combobox)
|
||||
|
||||
- 标题在上,带有水印,且为必填
|
||||
[参见Combobox](../combobox)
|
||||
|
||||
- 标题在上,带有水印,且为必填,同时自定义必填提示符
|
||||
[参见Combobox](../combobox)
|
||||
|
After Width: | Height: | Size: 885 B |
|
After Width: | Height: | Size: 1.5 KiB |
|
After Width: | Height: | Size: 1.2 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.9 KiB |
|
After Width: | Height: | Size: 1.3 KiB |
|
After Width: | Height: | Size: 2.0 KiB |
|
After Width: | Height: | Size: 1.8 KiB |
@@ -0,0 +1,25 @@
|
||||
---
|
||||
title: 快速开始
|
||||
---
|
||||
|
||||
# 第一步
|
||||
下载源码或者以Nuget的方式引用控件库。
|
||||
源码链接:[HandyControl-Github](https://github.com/HandyOrg/HandyControl)
|
||||
Nuget链接:[HandyControl-Nuget](https://www.nuget.org/packages/HandyControl/)
|
||||
|
||||
# 第二步
|
||||
在App.xaml中添加以下代码:
|
||||
|
||||
``` xml
|
||||
<Application.Resources>
|
||||
<ResourceDictionary>
|
||||
<ResourceDictionary.MergedDictionaries>
|
||||
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/SkinDefault.xaml"/>
|
||||
<ResourceDictionary Source="pack://application:,,,/HandyControl;component/Themes/Theme.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
</ResourceDictionary>
|
||||
</Application.Resources>
|
||||
```
|
||||
|
||||
# 第三步
|
||||
添加命名空间:`xmlns:hc="https://handyorg.github.io/handycontrol"`
|
||||
@@ -4,7 +4,7 @@ title: 鸣谢
|
||||
|
||||
# 感谢以下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></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提供使用建议
|
||||
|
||||
@@ -16,4 +16,4 @@ title: 鸣谢
|
||||
|
||||
# 感谢以下捐赠者
|
||||
|
||||
<p><a style="border:0" href="https://github.com/bigorange1900" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars1.githubusercontent.com/u/49062011?s=400&v=4" alt="bigorange1900"></a></p>
|
||||
<p><a style="border:0" href="https://github.com/bigorange1900" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars1.githubusercontent.com/u/49062011?s=400&v=4" alt="bigorange1900"></a><a style="border:0" href="https://github.com/14632791" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars3.githubusercontent.com/u/27358331?s=400&v=4" alt="bigorange1900"></a><a style="border:0" href="https://github.com/IUpdatable" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars2.githubusercontent.com/u/51181716?s=400&v=4" alt="bigorange1900"></a><a style="border:0" href="https://github.com/maplewei" target="_blank" rel="noopener"><img width="120" height="120" src="https://avatars1.githubusercontent.com/u/13778095?s=400&v=4" alt="bigorange1900"></a></p>
|
||||
@@ -161,8 +161,9 @@ menu:
|
||||
HandyControl:
|
||||
default: /handycontrol/ ||
|
||||
鸣谢: /tnx/ ||
|
||||
总览: /overview/ ||
|
||||
规范: /specifications/ ||
|
||||
快速开始: /quick_start/ ||
|
||||
# 总览: /overview/ ||
|
||||
# 规范: /specifications/ ||
|
||||
基础xaml定义:
|
||||
default: /basic_xaml/ ||
|
||||
行为: /behaviors/ ||
|
||||
@@ -176,21 +177,20 @@ menu:
|
||||
尺寸: /sizes/ ||
|
||||
附加属性:
|
||||
default: /attach/ ||
|
||||
BackgroundSwitchElement: /backgroundSwitchElement/ ||
|
||||
BorderElement: /borderElement/ ||
|
||||
DataGridAttach: /dataGridAttach/ ||
|
||||
BackgroundSwitchElement 可切换背景的元素: /backgroundSwitchElement/ ||
|
||||
BorderElement 具有边框的元素: /borderElement/ ||
|
||||
DataGridAttach DataGrid专用: /dataGridAttach/ ||
|
||||
EdgeElement: /edgeElement/ ||
|
||||
IconElement: /iconElement/ ||
|
||||
IconSwitchElement: /iconSwitchElement/ ||
|
||||
InfoElement: /infoElement/ ||
|
||||
LinkElement: /linkElement/ ||
|
||||
PanelElement: /panelElement/ ||
|
||||
PasswordBoxMonitor: /passwordBoxMonitor/ ||
|
||||
StatusSwitchElement: /statusSwitchElement/ ||
|
||||
TipElement: /tipElement/ ||
|
||||
TitleElement: /titleElement/ ||
|
||||
VisualElement: /visualElement/ ||
|
||||
WindowAttach: /windowAttach/ ||
|
||||
IconElement 具有图标的元素: /iconElement/ ||
|
||||
IconSwitchElement 可切换图标的元素: /iconSwitchElement/ ||
|
||||
InfoElement 信息元素: /infoElement/ ||
|
||||
PanelElement 面板元素: /panelElement/ ||
|
||||
PasswordBoxAttach 密码框专用: /passwordBoxAttach/ ||
|
||||
StatusSwitchElement 可切换状态的元素: /statusSwitchElement/ ||
|
||||
TipElement 提示元素: /tipElement/ ||
|
||||
TitleElement 标题元素: /titleElement/ ||
|
||||
VisualElement 可视化元素: /visualElement/ ||
|
||||
WindowAttach 窗体专用: /windowAttach/ ||
|
||||
原生控件:
|
||||
default: /native_controls/ ||
|
||||
Border 边框: /border/ ||
|
||||
|
||||
@@ -5,8 +5,12 @@
|
||||
<UseWPF>true</UseWPF>
|
||||
<AssemblyName>HandyControlDemo</AssemblyName>
|
||||
<RootNamespace>HandyControlDemo</RootNamespace>
|
||||
<Version>1.5.5</Version>
|
||||
<Version>2.0.0</Version>
|
||||
<ApplicationIcon>..\..\Shared\HandyControlDemo_Shared\Resources\Img\icon.ico</ApplicationIcon>
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
<Copyright>Copyright © HandyOrg 2018-2019</Copyright>
|
||||
<FileVersion>2.0.0.0</FileVersion>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DefineConstants>TRACE;Core</DefineConstants>
|
||||
@@ -315,7 +319,7 @@
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\WindowsForm_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\WindowsForm_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\WindowsForm_16x.png">
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\GridPane_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\GridPane_16x.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\qq-group.jpg">
|
||||
@@ -345,8 +349,8 @@
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\fabric-icons.ttf">
|
||||
<Link>Resources\fabric-icons.ttf</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\MainMenuControl_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\MainMenuControl_16x.png</Link>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\brackets_Square_16xLG.png">
|
||||
<Link>Resources\Img\LeftMainContent\brackets_Square_16xLG.png</Link>
|
||||
</Resource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -4,12 +4,13 @@
|
||||
<UseWPF>true</UseWPF>
|
||||
<AssemblyName>HandyControl</AssemblyName>
|
||||
<RootNamespace>HandyControl</RootNamespace>
|
||||
<Version>1.5.5</Version>
|
||||
<AssemblyVersion>1.5.5.0</AssemblyVersion>
|
||||
<Version>2.0.0</Version>
|
||||
<AssemblyVersion>2.0.0.0</AssemblyVersion>
|
||||
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
|
||||
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
|
||||
<Copyright>Copyright © HandyOrg 2018-2019</Copyright>
|
||||
<Description>Contains some commonly used simple WPF controls</Description>
|
||||
<Configurations>Debug;Release</Configurations>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
|
||||
<DefineConstants>TRACE;Core</DefineConstants>
|
||||
|
||||
@@ -37,12 +37,11 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="TreeViewItemBaseStyle" TargetType="TreeViewItem">
|
||||
<Style x:Key="TreeViewItemBaseStyle" BasedOn="{StaticResource BaseStyle}" TargetType="TreeViewItem">
|
||||
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisualRadius0Margin0}"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Padding" Value="10,0"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
@@ -96,6 +95,7 @@
|
||||
</Style>
|
||||
|
||||
<Style x:Key="TreeViewBaseStyle" TargetType="TreeView" BasedOn="{StaticResource BaseStyle}">
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
|
||||
@@ -25,7 +25,19 @@
|
||||
</Style>
|
||||
|
||||
<Style x:Key="DataGridCellStyle" TargetType="DataGridCell">
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="FocusVisualStyle">
|
||||
<Setter.Value>
|
||||
<Style>
|
||||
<Setter Property="Control.Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Rectangle Margin="2" Opacity=".6" SnapsToDevicePixels="true" Stroke="{DynamicResource SecondaryBorderBrush}" StrokeThickness="2" StrokeDashArray="1 1" RadiusX="4" RadiusY="4"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
@@ -211,7 +223,7 @@
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ComboBox">
|
||||
<TextBlock IsHitTestVisible="False" Text="{TemplateBinding Text}" Focusable="True" TextTrimming="CharacterEllipsis"/>
|
||||
<TextBlock IsHitTestVisible="False" Text="{TemplateBinding Text}" TextTrimming="CharacterEllipsis"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style TargetType="controls:Growl">
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="MinHeight" Value="60"/>
|
||||
<Setter Property="Width" Value="320"/>
|
||||
<Setter Property="Margin" Value="10,0,0,10"/>
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<StackPanel Name="ButtonPanel" WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MinimizeWindowCommand" IsTabStop="False" Name="ButtonMin" Height="29" Style="{StaticResource ButtonIcon}" Width="45" controls:IconElement.Geometry="{StaticResource WindowMinGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MaximizeWindowCommand" IsTabStop="False" Name="ButtonMax" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowMaxGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.RestoreWindowCommand" IsTabStop="False" Name="ButtonRestore" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
@@ -110,6 +110,7 @@
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsActive" Value="False">
|
||||
<Setter Property="Opacity" Value=".8" TargetName="ContentPresenterMain"/>
|
||||
<Setter Property="Opacity" Value=".8" TargetName="ButtonPanel"/>
|
||||
</Trigger>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="Icon"/>
|
||||
|
||||
@@ -0,0 +1,183 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.28729.10
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandyControl_Net_GE45", "Net_GE45\HandyControl_Net_GE45\HandyControl_Net_GE45.csproj", "{DC966E3D-BCFF-4652-98CF-070E5494749A}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandyControlDemo_Net_GE45", "Net_GE45\HandyControlDemo_Net_GE45\HandyControlDemo_Net_GE45.csproj", "{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Net_GE45", "Net_GE45", "{2F551C62-77F7-4FA5-8AD7-FCF53E92AE08}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Shared", "Shared", "{0938270D-E9F0-489B-AF9E-5C5AD7C69897}"
|
||||
EndProject
|
||||
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "HandyControl_Shared", "Shared\HandyControl_Shared\HandyControl_Shared.shproj", "{AAC11083-FACA-405D-9197-5C1212D65656}"
|
||||
EndProject
|
||||
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "HandyControlDemo_Shared", "Shared\HandyControlDemo_Shared\HandyControlDemo_Shared.shproj", "{C4694269-C9B8-45D5-87F8-D0088C532510}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Net_40", "Net_40", "{35E3F9C0-8924-4536-BE09-F3761FDBF066}"
|
||||
EndProject
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Core_30", "Core_30", "{B838C973-06F0-48A1-B259-A357AAF2D8D4}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HandyControl_Core_30", "Core_30\HandyControl_Core_30\HandyControl_Core_30.csproj", "{BE4A567D-B6E0-413E-8F64-E1A53B4F9366}"
|
||||
EndProject
|
||||
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "HandyControlDemo_Core30", "Core_30\HandyControlDemo_Core_30\HandyControlDemo_Core30.csproj", "{D7107690-8592-4F9F-9379-9B82C1C15D2A}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandyControl_Net_40", "Net_40\HandyControl_Net_40\HandyControl_Net_40.csproj", "{32204503-2EF0-4681-AE13-AA1FEB6C658A}"
|
||||
EndProject
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandyControlDemo_Net_40", "Net_40\HandyControlDemo_Net_40\HandyControlDemo_Net_40.csproj", "{D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SharedMSBuildProjectFiles) = preSolution
|
||||
Shared\HandyControl_Shared\HandyControl_Shared.projitems*{32204503-2ef0-4681-ae13-aa1feb6c658a}*SharedItemsImports = 4
|
||||
Shared\HandyControlDemo_Shared\HandyControlDemo_Shared.projitems*{9a7b52e6-94bb-4e7e-bb6a-7cf6761b79a7}*SharedItemsImports = 4
|
||||
Shared\HandyControl_Shared\HandyControl_Shared.projitems*{aac11083-faca-405d-9197-5c1212d65656}*SharedItemsImports = 13
|
||||
Shared\HandyControlDemo_Shared\HandyControlDemo_Shared.projitems*{c4694269-c9b8-45d5-87f8-d0088c532510}*SharedItemsImports = 13
|
||||
Shared\HandyControlDemo_Shared\HandyControlDemo_Shared.projitems*{d8ae88f8-c36b-4d10-a7f9-22ffcfba5231}*SharedItemsImports = 4
|
||||
Shared\HandyControl_Shared\HandyControl_Shared.projitems*{dc966e3d-bcff-4652-98cf-070e5494749a}*SharedItemsImports = 4
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug-Core30|Any CPU = Debug-Core30|Any CPU
|
||||
Debug-Net40|Any CPU = Debug-Net40|Any CPU
|
||||
Debug-Net45|Any CPU = Debug-Net45|Any CPU
|
||||
Debug-Net462|Any CPU = Debug-Net462|Any CPU
|
||||
Debug-Net47|Any CPU = Debug-Net47|Any CPU
|
||||
Debug-Net48|Any CPU = Debug-Net48|Any CPU
|
||||
Release-Core30|Any CPU = Release-Core30|Any CPU
|
||||
Release-Net40|Any CPU = Release-Net40|Any CPU
|
||||
Release-Net45|Any CPU = Release-Net45|Any CPU
|
||||
Release-Net462|Any CPU = Release-Net462|Any CPU
|
||||
Release-Net47|Any CPU = Release-Net47|Any CPU
|
||||
Release-Net48|Any CPU = Release-Net48|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Core30|Any CPU.ActiveCfg = Debug-Net45|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net40|Any CPU.ActiveCfg = Debug-Net45|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net45|Any CPU.ActiveCfg = Debug-Net45|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net45|Any CPU.Build.0 = Debug-Net45|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net462|Any CPU.ActiveCfg = Debug-Net462|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net462|Any CPU.Build.0 = Debug-Net462|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net47|Any CPU.ActiveCfg = Debug-Net47|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net47|Any CPU.Build.0 = Debug-Net47|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net48|Any CPU.ActiveCfg = Debug-Net48|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net48|Any CPU.Build.0 = Debug-Net48|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Core30|Any CPU.ActiveCfg = Release-Net45|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net40|Any CPU.ActiveCfg = Release-Net45|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net45|Any CPU.ActiveCfg = Release-Net45|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net45|Any CPU.Build.0 = Release-Net45|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net462|Any CPU.ActiveCfg = Release-Net462|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net462|Any CPU.Build.0 = Release-Net462|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net47|Any CPU.ActiveCfg = Release-Net47|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net47|Any CPU.Build.0 = Release-Net47|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net48|Any CPU.ActiveCfg = Release-Net48|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net48|Any CPU.Build.0 = Release-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Core30|Any CPU.ActiveCfg = Debug-Net45|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net40|Any CPU.ActiveCfg = Debug-Net45|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net45|Any CPU.ActiveCfg = Debug-Net45|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net45|Any CPU.Build.0 = Debug-Net45|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net462|Any CPU.ActiveCfg = Debug-Net462|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net462|Any CPU.Build.0 = Debug-Net462|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net47|Any CPU.ActiveCfg = Debug-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net47|Any CPU.Build.0 = Debug-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net48|Any CPU.ActiveCfg = Debug-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net48|Any CPU.Build.0 = Debug-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Core30|Any CPU.ActiveCfg = Release-Net45|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net40|Any CPU.ActiveCfg = Release-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net45|Any CPU.ActiveCfg = Release-Net45|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net45|Any CPU.Build.0 = Release-Net45|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net462|Any CPU.ActiveCfg = Release-Net462|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net462|Any CPU.Build.0 = Release-Net462|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net47|Any CPU.ActiveCfg = Release-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net47|Any CPU.Build.0 = Release-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net48|Any CPU.ActiveCfg = Release-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net48|Any CPU.Build.0 = Release-Net48|Any CPU
|
||||
{BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Debug-Core30|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Debug-Core30|Any CPU.Build.0 = Debug|Any CPU
|
||||
{BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Debug-Net40|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Debug-Net45|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Debug-Net462|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Debug-Net47|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Debug-Net48|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Release-Core30|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Release-Core30|Any CPU.Build.0 = Release|Any CPU
|
||||
{BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Release-Net40|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Release-Net45|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Release-Net45|Any CPU.Build.0 = Release|Any CPU
|
||||
{BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Release-Net462|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Release-Net462|Any CPU.Build.0 = Release|Any CPU
|
||||
{BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Release-Net47|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Release-Net47|Any CPU.Build.0 = Release|Any CPU
|
||||
{BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Release-Net48|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{BE4A567D-B6E0-413E-8F64-E1A53B4F9366}.Release-Net48|Any CPU.Build.0 = Release|Any CPU
|
||||
{D7107690-8592-4F9F-9379-9B82C1C15D2A}.Debug-Core30|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D7107690-8592-4F9F-9379-9B82C1C15D2A}.Debug-Core30|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D7107690-8592-4F9F-9379-9B82C1C15D2A}.Debug-Net40|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D7107690-8592-4F9F-9379-9B82C1C15D2A}.Debug-Net45|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D7107690-8592-4F9F-9379-9B82C1C15D2A}.Debug-Net462|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D7107690-8592-4F9F-9379-9B82C1C15D2A}.Debug-Net47|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D7107690-8592-4F9F-9379-9B82C1C15D2A}.Debug-Net48|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D7107690-8592-4F9F-9379-9B82C1C15D2A}.Release-Core30|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D7107690-8592-4F9F-9379-9B82C1C15D2A}.Release-Core30|Any CPU.Build.0 = Release|Any CPU
|
||||
{D7107690-8592-4F9F-9379-9B82C1C15D2A}.Release-Net40|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D7107690-8592-4F9F-9379-9B82C1C15D2A}.Release-Net45|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D7107690-8592-4F9F-9379-9B82C1C15D2A}.Release-Net45|Any CPU.Build.0 = Release|Any CPU
|
||||
{D7107690-8592-4F9F-9379-9B82C1C15D2A}.Release-Net462|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D7107690-8592-4F9F-9379-9B82C1C15D2A}.Release-Net462|Any CPU.Build.0 = Release|Any CPU
|
||||
{D7107690-8592-4F9F-9379-9B82C1C15D2A}.Release-Net47|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D7107690-8592-4F9F-9379-9B82C1C15D2A}.Release-Net47|Any CPU.Build.0 = Release|Any CPU
|
||||
{D7107690-8592-4F9F-9379-9B82C1C15D2A}.Release-Net48|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D7107690-8592-4F9F-9379-9B82C1C15D2A}.Release-Net48|Any CPU.Build.0 = Release|Any CPU
|
||||
{32204503-2EF0-4681-AE13-AA1FEB6C658A}.Debug-Core30|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{32204503-2EF0-4681-AE13-AA1FEB6C658A}.Debug-Net40|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{32204503-2EF0-4681-AE13-AA1FEB6C658A}.Debug-Net40|Any CPU.Build.0 = Debug|Any CPU
|
||||
{32204503-2EF0-4681-AE13-AA1FEB6C658A}.Debug-Net45|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{32204503-2EF0-4681-AE13-AA1FEB6C658A}.Debug-Net462|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{32204503-2EF0-4681-AE13-AA1FEB6C658A}.Debug-Net47|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{32204503-2EF0-4681-AE13-AA1FEB6C658A}.Debug-Net48|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{32204503-2EF0-4681-AE13-AA1FEB6C658A}.Release-Core30|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{32204503-2EF0-4681-AE13-AA1FEB6C658A}.Release-Net40|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{32204503-2EF0-4681-AE13-AA1FEB6C658A}.Release-Net40|Any CPU.Build.0 = Release|Any CPU
|
||||
{32204503-2EF0-4681-AE13-AA1FEB6C658A}.Release-Net45|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{32204503-2EF0-4681-AE13-AA1FEB6C658A}.Release-Net45|Any CPU.Build.0 = Release|Any CPU
|
||||
{32204503-2EF0-4681-AE13-AA1FEB6C658A}.Release-Net462|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{32204503-2EF0-4681-AE13-AA1FEB6C658A}.Release-Net462|Any CPU.Build.0 = Release|Any CPU
|
||||
{32204503-2EF0-4681-AE13-AA1FEB6C658A}.Release-Net47|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{32204503-2EF0-4681-AE13-AA1FEB6C658A}.Release-Net47|Any CPU.Build.0 = Release|Any CPU
|
||||
{32204503-2EF0-4681-AE13-AA1FEB6C658A}.Release-Net48|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{32204503-2EF0-4681-AE13-AA1FEB6C658A}.Release-Net48|Any CPU.Build.0 = Release|Any CPU
|
||||
{D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Debug-Core30|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Debug-Net40|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Debug-Net40|Any CPU.Build.0 = Debug|Any CPU
|
||||
{D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Debug-Net45|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Debug-Net462|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Debug-Net47|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Debug-Net48|Any CPU.ActiveCfg = Debug|Any CPU
|
||||
{D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Release-Core30|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Release-Net40|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Release-Net40|Any CPU.Build.0 = Release|Any CPU
|
||||
{D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Release-Net45|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Release-Net45|Any CPU.Build.0 = Release|Any CPU
|
||||
{D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Release-Net462|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Release-Net462|Any CPU.Build.0 = Release|Any CPU
|
||||
{D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Release-Net47|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Release-Net47|Any CPU.Build.0 = Release|Any CPU
|
||||
{D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Release-Net48|Any CPU.ActiveCfg = Release|Any CPU
|
||||
{D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231}.Release-Net48|Any CPU.Build.0 = Release|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
EndGlobalSection
|
||||
GlobalSection(NestedProjects) = preSolution
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A} = {2F551C62-77F7-4FA5-8AD7-FCF53E92AE08}
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7} = {2F551C62-77F7-4FA5-8AD7-FCF53E92AE08}
|
||||
{AAC11083-FACA-405D-9197-5C1212D65656} = {0938270D-E9F0-489B-AF9E-5C5AD7C69897}
|
||||
{C4694269-C9B8-45D5-87F8-D0088C532510} = {0938270D-E9F0-489B-AF9E-5C5AD7C69897}
|
||||
{BE4A567D-B6E0-413E-8F64-E1A53B4F9366} = {B838C973-06F0-48A1-B259-A357AAF2D8D4}
|
||||
{D7107690-8592-4F9F-9379-9B82C1C15D2A} = {B838C973-06F0-48A1-B259-A357AAF2D8D4}
|
||||
{32204503-2EF0-4681-AE13-AA1FEB6C658A} = {35E3F9C0-8924-4536-BE09-F3761FDBF066}
|
||||
{D8AE88F8-C36B-4D10-A7F9-22FFCFBA5231} = {35E3F9C0-8924-4536-BE09-F3761FDBF066}
|
||||
EndGlobalSection
|
||||
GlobalSection(ExtensibilityGlobals) = postSolution
|
||||
SolutionGuid = {D4636382-1A18-4079-A3E7-054DD970F179}
|
||||
EndGlobalSection
|
||||
EndGlobal
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.27703.2035
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.28729.10
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Net_40", "Net_40", "{763DABFC-950A-4965-97CB-15C59A928401}"
|
||||
EndProject
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
|
||||
Microsoft Visual Studio Solution File, Format Version 12.00
|
||||
# Visual Studio 15
|
||||
VisualStudioVersion = 15.0.27703.2035
|
||||
# Visual Studio Version 16
|
||||
VisualStudioVersion = 16.0.28729.10
|
||||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "HandyControl_Net_GE45", "Net_GE45\HandyControl_Net_GE45\HandyControl_Net_GE45.csproj", "{DC966E3D-BCFF-4652-98CF-070E5494749A}"
|
||||
EndProject
|
||||
@@ -26,9 +26,11 @@ Global
|
||||
Debug-Net45|Any CPU = Debug-Net45|Any CPU
|
||||
Debug-Net462|Any CPU = Debug-Net462|Any CPU
|
||||
Debug-Net47|Any CPU = Debug-Net47|Any CPU
|
||||
Debug-Net48|Any CPU = Debug-Net48|Any CPU
|
||||
Release-Net45|Any CPU = Release-Net45|Any CPU
|
||||
Release-Net462|Any CPU = Release-Net462|Any CPU
|
||||
Release-Net47|Any CPU = Release-Net47|Any CPU
|
||||
Release-Net48|Any CPU = Release-Net48|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(ProjectConfigurationPlatforms) = postSolution
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net45|Any CPU.ActiveCfg = Debug-Net45|Any CPU
|
||||
@@ -37,24 +39,32 @@ Global
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net462|Any CPU.Build.0 = Debug-Net462|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net47|Any CPU.ActiveCfg = Debug-Net47|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net47|Any CPU.Build.0 = Debug-Net47|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net48|Any CPU.ActiveCfg = Debug-Net48|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Debug-Net48|Any CPU.Build.0 = Debug-Net48|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net45|Any CPU.ActiveCfg = Release-Net45|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net45|Any CPU.Build.0 = Release-Net45|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net462|Any CPU.ActiveCfg = Release-Net462|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net462|Any CPU.Build.0 = Release-Net462|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net47|Any CPU.ActiveCfg = Release-Net47|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net47|Any CPU.Build.0 = Release-Net47|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net48|Any CPU.ActiveCfg = Release-Net48|Any CPU
|
||||
{DC966E3D-BCFF-4652-98CF-070E5494749A}.Release-Net48|Any CPU.Build.0 = Release-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net45|Any CPU.ActiveCfg = Debug-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net45|Any CPU.Build.0 = Debug-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net462|Any CPU.ActiveCfg = Debug-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net462|Any CPU.Build.0 = Debug-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net47|Any CPU.ActiveCfg = Debug-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net47|Any CPU.Build.0 = Debug-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net45|Any CPU.ActiveCfg = Release-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net45|Any CPU.Build.0 = Release-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net462|Any CPU.ActiveCfg = Release-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net462|Any CPU.Build.0 = Release-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net47|Any CPU.ActiveCfg = Release-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net47|Any CPU.Build.0 = Release-Net47|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net462|Any CPU.ActiveCfg = Debug-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net462|Any CPU.Build.0 = Debug-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net47|Any CPU.ActiveCfg = Debug-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net47|Any CPU.Build.0 = Debug-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net48|Any CPU.ActiveCfg = Debug-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Debug-Net48|Any CPU.Build.0 = Debug-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net45|Any CPU.ActiveCfg = Release-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net45|Any CPU.Build.0 = Release-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net462|Any CPU.ActiveCfg = Release-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net462|Any CPU.Build.0 = Release-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net47|Any CPU.ActiveCfg = Release-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net47|Any CPU.Build.0 = Release-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net48|Any CPU.ActiveCfg = Release-Net48|Any CPU
|
||||
{9A7B52E6-94BB-4E7E-BB6A-7CF6761B79A7}.Release-Net48|Any CPU.Build.0 = Release-Net48|Any CPU
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
<wpf:ResourceDictionary xml:space="preserve" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" xmlns:s="clr-namespace:System;assembly=mscorlib" xmlns:ss="urn:shemas-jetbrains-com:settings-storage-xaml" xmlns:wpf="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<s:Boolean x:Key="/Default/CodeInspection/CodeAnnotations/NamespacesWithAnnotations/=HandyControl_002EAnnotations/@EntryIndexedValue">True</s:Boolean></wpf:ResourceDictionary>
|
||||
@@ -395,6 +395,9 @@
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
||||
</Content>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\brackets_Square_16xLG.png">
|
||||
<Link>Resources\Img\LeftMainContent\brackets_Square_16xLG.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\GridPane_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\GridPane_16x.png</Link>
|
||||
</Resource>
|
||||
|
||||
@@ -37,12 +37,11 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="TreeViewItemBaseStyle" TargetType="TreeViewItem">
|
||||
<Style x:Key="TreeViewItemBaseStyle" BasedOn="{StaticResource BaseStyle}" TargetType="TreeViewItem">
|
||||
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisualRadius0Margin0}"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Padding" Value="10,0"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
@@ -96,6 +95,7 @@
|
||||
</Style>
|
||||
|
||||
<Style x:Key="TreeViewBaseStyle" TargetType="TreeView" BasedOn="{StaticResource BaseStyle}">
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
|
||||
@@ -25,7 +25,19 @@
|
||||
</Style>
|
||||
|
||||
<Style x:Key="DataGridCellStyle" TargetType="DataGridCell">
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="FocusVisualStyle">
|
||||
<Setter.Value>
|
||||
<Style>
|
||||
<Setter Property="Control.Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Rectangle Margin="2" Opacity=".6" SnapsToDevicePixels="true" Stroke="{DynamicResource SecondaryBorderBrush}" StrokeThickness="2" StrokeDashArray="1 1" RadiusX="4" RadiusY="4"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
@@ -212,7 +224,7 @@
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ComboBox">
|
||||
<TextBlock IsHitTestVisible="False" Text="{TemplateBinding Text}" Focusable="True" TextTrimming="CharacterEllipsis"/>
|
||||
<TextBlock IsHitTestVisible="False" Text="{TemplateBinding Text}" TextTrimming="CharacterEllipsis"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style TargetType="controls:Growl">
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="MinHeight" Value="60"/>
|
||||
<Setter Property="Width" Value="320"/>
|
||||
<Setter Property="Margin" Value="10,0,0,10"/>
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel shell:WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<StackPanel Name="ButtonPanel" shell:WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="shell:SystemCommands.MinimizeWindowCommand" IsTabStop="False" Name="ButtonMin" Height="29" Style="{StaticResource ButtonIcon}" Width="45" controls:IconElement.Geometry="{StaticResource WindowMinGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="shell:SystemCommands.MaximizeWindowCommand" IsTabStop="False" Name="ButtonMax" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowMaxGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="shell:SystemCommands.RestoreWindowCommand" IsTabStop="False" Name="ButtonRestore" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
@@ -110,6 +110,7 @@
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsActive" Value="False">
|
||||
<Setter Property="Opacity" Value=".8" TargetName="ContentPresenterMain"/>
|
||||
<Setter Property="Opacity" Value=".8" TargetName="ButtonPanel"/>
|
||||
</Trigger>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="Icon"/>
|
||||
|
||||
@@ -15,8 +15,20 @@
|
||||
<TargetFrameworkProfile />
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug-Net45|AnyCPU'">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug-Net462|AnyCPU'">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
@@ -38,7 +50,28 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug-Net48|AnyCPU'">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-Net45|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-Net462|AnyCPU' ">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
@@ -58,6 +91,16 @@
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Net48|AnyCPU'">
|
||||
<PlatformTarget>AnyCPU</PlatformTarget>
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<ApplicationIcon>..\..\Shared\HandyControlDemo_Shared\Resources\Img\icon.ico</ApplicationIcon>
|
||||
</PropertyGroup>
|
||||
@@ -414,6 +457,9 @@
|
||||
<Generator>TextTemplatingFileGenerator</Generator>
|
||||
<LastGenOutput>MessageToken.cs</LastGenOutput>
|
||||
</Content>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\brackets_Square_16xLG.png">
|
||||
<Link>Resources\Img\LeftMainContent\brackets_Square_16xLG.png</Link>
|
||||
</Resource>
|
||||
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\GridPane_16x.png">
|
||||
<Link>Resources\Img\LeftMainContent\GridPane_16x.png</Link>
|
||||
</Resource>
|
||||
|
||||
@@ -13,6 +13,18 @@
|
||||
<TargetFrameworkProfile />
|
||||
<NuGetPackageImportStamp>
|
||||
</NuGetPackageImportStamp>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug-Net45|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;netle45</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<netVersion>netgt40</netVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug-Net462|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
@@ -36,21 +48,32 @@
|
||||
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
|
||||
<netVersion>netgt40</netVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug-Net45|AnyCPU' ">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug-Net48|AnyCPU'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>bin\Debug\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE;netle45</DefineConstants>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<netVersion>netgt40</netVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-Net45|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\Net45\</OutputPath>
|
||||
<DefineConstants>TRACE;netle45</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DocumentationFile>bin\Release\HandyControl.xml</DocumentationFile>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<netVersion>netgt40</netVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-Net462|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<OutputPath>bin\Release\Net462\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
@@ -61,7 +84,7 @@
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-Net47|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<OutputPath>bin\Release\Net47\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
@@ -69,15 +92,15 @@
|
||||
<TargetFrameworkVersion>v4.7</TargetFrameworkVersion>
|
||||
<netVersion>netgt40</netVersion>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release-Net45|AnyCPU' ">
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release-Net48|AnyCPU'">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>bin\Release\</OutputPath>
|
||||
<DefineConstants>TRACE;netle45</DefineConstants>
|
||||
<OutputPath>bin\Release\Net48\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<DocumentationFile>bin\Release\HandyControl.xml</DocumentationFile>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<TargetFrameworkVersion>v4.8</TargetFrameworkVersion>
|
||||
<netVersion>netgt40</netVersion>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
@@ -139,6 +162,7 @@
|
||||
<Link>Properties\Langs\Lang.resx</Link>
|
||||
<Generator>PublicResXFileCodeGenerator</Generator>
|
||||
<LastGenOutput>Lang.Designer.cs</LastGenOutput>
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
|
||||
@@ -37,12 +37,11 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="TreeViewItemBaseStyle" TargetType="TreeViewItem">
|
||||
<Style x:Key="TreeViewItemBaseStyle" BasedOn="{StaticResource BaseStyle}" TargetType="TreeViewItem">
|
||||
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisualRadius0Margin0}"/>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="Padding" Value="10,0"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
@@ -96,6 +95,7 @@
|
||||
</Style>
|
||||
|
||||
<Style x:Key="TreeViewBaseStyle" TargetType="TreeView" BasedOn="{StaticResource BaseStyle}">
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="1"/>
|
||||
|
||||
@@ -25,7 +25,19 @@
|
||||
</Style>
|
||||
|
||||
<Style x:Key="DataGridCellStyle" TargetType="DataGridCell">
|
||||
<Setter Property="FocusVisualStyle" Value="{x:Null}"/>
|
||||
<Setter Property="FocusVisualStyle">
|
||||
<Setter.Value>
|
||||
<Style>
|
||||
<Setter Property="Control.Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate>
|
||||
<Rectangle Margin="2" Opacity=".6" SnapsToDevicePixels="true" Stroke="{DynamicResource SecondaryBorderBrush}" StrokeThickness="2" StrokeDashArray="1 1" RadiusX="4" RadiusY="4"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
</Style>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="BorderBrush" Value="Transparent"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
@@ -211,7 +223,7 @@
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ComboBox">
|
||||
<TextBlock IsHitTestVisible="False" Text="{TemplateBinding Text}" Focusable="True" TextTrimming="CharacterEllipsis"/>
|
||||
<TextBlock IsHitTestVisible="False" Text="{TemplateBinding Text}" TextTrimming="CharacterEllipsis"/>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style TargetType="controls:Growl">
|
||||
<Setter Property="Focusable" Value="False"/>
|
||||
<Setter Property="MinHeight" Value="60"/>
|
||||
<Setter Property="Width" Value="320"/>
|
||||
<Setter Property="Margin" Value="10,0,0,10"/>
|
||||
|
||||
@@ -84,7 +84,7 @@
|
||||
<ColumnDefinition/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<StackPanel Name="ButtonPanel" WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MinimizeWindowCommand" IsTabStop="False" Name="ButtonMin" Height="29" Style="{StaticResource ButtonIcon}" Width="45" controls:IconElement.Geometry="{StaticResource WindowMinGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MaximizeWindowCommand" IsTabStop="False" Name="ButtonMax" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowMaxGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.RestoreWindowCommand" IsTabStop="False" Name="ButtonRestore" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
@@ -110,6 +110,7 @@
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsActive" Value="False">
|
||||
<Setter Property="Opacity" Value=".8" TargetName="ContentPresenterMain"/>
|
||||
<Setter Property="Opacity" Value=".8" TargetName="ButtonPanel"/>
|
||||
</Trigger>
|
||||
<Trigger Property="Icon" Value="{x:Null}">
|
||||
<Setter Property="Visibility" Value="Collapsed" TargetName="Icon"/>
|
||||
|
||||
@@ -97,6 +97,8 @@
|
||||
public static readonly string GridDemoCtl = nameof(GridDemoCtl);
|
||||
|
||||
public static readonly string PoptipDemoCtl = nameof(PoptipDemoCtl);
|
||||
|
||||
public static readonly string RangeSliderDemoCtl = nameof(RangeSliderDemoCtl);
|
||||
|
||||
public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
|
||||
|
||||
|
||||
@@ -51,7 +51,8 @@ var controlList = new List<string>
|
||||
"DialogDemoCtl",
|
||||
"SideMenuDemoCtl",
|
||||
"GridDemoCtl",
|
||||
"PoptipDemoCtl"
|
||||
"PoptipDemoCtl",
|
||||
"RangeSliderDemoCtl"
|
||||
};
|
||||
var styleList = new List<string>
|
||||
{
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
<SubType>Code</SubType>
|
||||
<DependentUpon>MainWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<!-- <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" />
|
||||
@@ -48,6 +47,12 @@
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\AnimationPathDemoCtl.xaml.cs">
|
||||
<DependentUpon>AnimationPathDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\RangeSliderDemoCtl.xaml.cs">
|
||||
<DependentUpon>RangeSliderDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\RelativePanelDemoCtl.xaml.cs">
|
||||
<DependentUpon>RelativePanelDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\BadgeDemoCtl.xaml.cs">
|
||||
<DependentUpon>BadgeDemoCtl.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -397,6 +402,14 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\RelativePanelDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\RangeSliderDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="$(MSBuildThisFileDirectory)UserControl\Controls\BadgeDemoCtl.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -13,5 +13,5 @@ using System.Windows;
|
||||
[assembly: AssemblyCulture("")]
|
||||
[assembly: ComVisible(false)]
|
||||
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
|
||||
[assembly: AssemblyVersion("1.5.5")]
|
||||
[assembly: AssemblyVersion("2.0.0")]
|
||||
#endif
|
||||
@@ -609,4 +609,16 @@
|
||||
<data name="Project" xml:space="preserve">
|
||||
<value>Project</value>
|
||||
</data>
|
||||
<data name="RangeSlider" xml:space="preserve">
|
||||
<value>RangeSlider</value>
|
||||
</data>
|
||||
<data name="RelativePanel" xml:space="preserve">
|
||||
<value>RelativePanel</value>
|
||||
</data>
|
||||
<data name="On" xml:space="preserve">
|
||||
<value>On</value>
|
||||
</data>
|
||||
<data name="Off" xml:space="preserve">
|
||||
<value>Off</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -609,4 +609,16 @@
|
||||
<data name="Project" xml:space="preserve">
|
||||
<value>项目</value>
|
||||
</data>
|
||||
<data name="RangeSlider" xml:space="preserve">
|
||||
<value>范围滑块</value>
|
||||
</data>
|
||||
<data name="RelativePanel" xml:space="preserve">
|
||||
<value>相对布局</value>
|
||||
</data>
|
||||
<data name="On" xml:space="preserve">
|
||||
<value>开</value>
|
||||
</data>
|
||||
<data name="Off" xml:space="preserve">
|
||||
<value>关</value>
|
||||
</data>
|
||||
</root>
|
||||
|
After Width: | Height: | Size: 176 B |
@@ -19,7 +19,7 @@ namespace HandyControlDemo.Service
|
||||
for (var i = 1; i <= 20; i++)
|
||||
{
|
||||
var dataList = new List<DemoDataModel>();
|
||||
for (int j = 0; j < 3; j++)
|
||||
for (var j = 0; j < 3; j++)
|
||||
{
|
||||
dataList.Add(new DemoDataModel
|
||||
{
|
||||
@@ -135,6 +135,12 @@ namespace HandyControlDemo.Service
|
||||
DisplayName = "AutumnBox",
|
||||
AvatarUri = "https://www.atmb.top/images/leaves.png",
|
||||
Link = "https://github.com/zsh2401/AutumnBox"
|
||||
},
|
||||
new AvatarModel
|
||||
{
|
||||
DisplayName = "PandaX Studio",
|
||||
AvatarUri = "https://raw.githubusercontent.com/aboutlong/pandaxstudio/master/pandax/pandax/source/image/logo.png",
|
||||
Link = "https://github.com/aboutlong/pandaxstudio"
|
||||
}
|
||||
};
|
||||
}
|
||||
|
||||
@@ -0,0 +1,22 @@
|
||||
<UserControl x:Class="HandyControlDemo.UserControl.RangeSliderDemoCtl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
Background="{DynamicResource RegionBrush}">
|
||||
<hc:TransitioningContentControl>
|
||||
<StackPanel Margin="32" Orientation="Horizontal">
|
||||
<StackPanel>
|
||||
<hc:RangeSlider Width="400" IsSnapToTickEnabled="True" ValueStart="2" ValueEnd="8"/>
|
||||
<hc:RangeSlider Width="400" IsSnapToTickEnabled="True" ValueEnd="3" Margin="0,32,0,0" IsEnabled="False"/>
|
||||
<hc:RangeSlider Width="400" hc:TipElement.Visibility="Visible" IsSnapToTickEnabled="True" Maximum="100" ValueEnd="60" TickFrequency="10" TickPlacement="BottomRight" Margin="0,32,0,0"/>
|
||||
<hc:RangeSlider Width="400" hc:TipElement.Visibility="Visible" hc:TipElement.Placement="BottomRight" IsSnapToTickEnabled="True" ValueEnd="5" TickPlacement="Both" Margin="0,32,0,0"/>
|
||||
</StackPanel>
|
||||
<StackPanel Margin="32,0,0,0" Orientation="Horizontal">
|
||||
<hc:RangeSlider Height="400" IsSnapToTickEnabled="True" ValueEnd="8" Orientation="Vertical"/>
|
||||
<hc:RangeSlider Height="400" IsSnapToTickEnabled="True" ValueEnd="3" Margin="32,0,0,0" IsEnabled="False" Orientation="Vertical"/>
|
||||
<hc:RangeSlider Height="400" hc:TipElement.Visibility="Visible" IsSnapToTickEnabled="True" Maximum="100" ValueEnd="60" TickFrequency="10" TickPlacement="BottomRight" Margin="32,0,0,0" Orientation="Vertical"/>
|
||||
<hc:RangeSlider Height="400" hc:TipElement.Visibility="Visible" hc:TipElement.Placement="BottomRight" IsSnapToTickEnabled="True" ValueEnd="5" TickPlacement="Both" Margin="32,0" Orientation="Vertical"/>
|
||||
</StackPanel>
|
||||
</StackPanel>
|
||||
</hc:TransitioningContentControl>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class RangeSliderDemoCtl
|
||||
{
|
||||
public RangeSliderDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
<UserControl x:Class="HandyControlDemo.UserControl.RelativePanelDemoCtl"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:userControl="clr-namespace:HandyControlDemo.UserControl">
|
||||
<userControl:UnderConstruction/>
|
||||
</UserControl>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
public partial class RelativePanelDemoCtl
|
||||
{
|
||||
public RelativePanelDemoCtl()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -335,7 +335,7 @@
|
||||
<Image Source="../../Resources/Img/LeftMainContent/LinearCarousel_16x.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.ProgressBarDemoCtl}" Content="{x:Static langs:Lang.ProgressBar}">
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.ProgressBarDemoCtl}" Content="{x:Static langs:Lang.ProgressBar}">
|
||||
<hc:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/ProgressBar_16x.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
@@ -380,6 +380,11 @@
|
||||
<Image Source="../../Resources/Img/LeftMainContent/HoverMenu_16x.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.RangeSliderDemoCtl}" Content="{x:Static langs:Lang.RangeSlider}">
|
||||
<hc:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/brackets_Square_16xLG.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.TimeBarDemoCtl}" Content="{x:Static langs:Lang.TimeBar}">
|
||||
<hc:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/Timeline_16x.png"/>
|
||||
@@ -410,7 +415,7 @@
|
||||
<Image Source="../../Resources/Img/LeftMainContent/ScrollBox_16x.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
</ListBoxItem>
|
||||
<ListBoxItem Style="{StaticResource ListBoxItemNew}" Tag="{x:Static data:MessageToken.DialogDemoCtl}" Content="{x:Static langs:Lang.Dialog}">
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.DialogDemoCtl}" Content="{x:Static langs:Lang.Dialog}">
|
||||
<hc:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/Dialog_16x.png"/>
|
||||
</hc:EdgeElement.LeftContent>
|
||||
|
||||
@@ -1,9 +1,5 @@
|
||||
|
||||
namespace HandyControlDemo.UserControl
|
||||
namespace HandyControlDemo.UserControl
|
||||
{
|
||||
/// <summary>
|
||||
/// ButtonDemoCtl.xaml 的交互逻辑
|
||||
/// </summary>
|
||||
public partial class ButtonDemoCtl
|
||||
{
|
||||
public ButtonDemoCtl()
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
<ComboBox ItemsSource="{Binding DataList}" SelectedIndex="0" Margin="0,16,0,0" IsEditable="True"/>
|
||||
|
||||
<ComboBox ItemsSource="{Binding DataList}" SelectedIndex="0" hc:InfoElement.Title="{x:Static langs:Lang.TitleDemoStr1}" Style="{StaticResource ComboBoxExtend}" Margin="0,32,0,0" Text="{x:Static langs:Lang.ContentDemoStr}"/>
|
||||
<ComboBox ItemsSource="{Binding DataList}" hc:InfoElement.Placeholder="{x:Static langs:Lang.PlsEnterContent}" hc:InfoElement.Title="{x:Static langs:Lang.TitleDemoStr2}" Style="{StaticResource ComboBoxExtend}" hc:InfoElement.Necessary="True" Margin="0,16,0,0"/>
|
||||
<ComboBox ItemsSource="{Binding DataList}" hc:InfoElement.Placeholder="{x:Static langs:Lang.PlsEnterContent}" hc:InfoElement.Title="{x:Static langs:Lang.TitleDemoStr2}" Style="{StaticResource ComboBoxExtend}" hc:InfoElement.Necessary="True" hc:InfoElement.Symbol="*" Margin="0,16,0,0"/>
|
||||
<ComboBox ItemsSource="{Binding DataList}" IsEditable="True" SelectedIndex="0" hc:InfoElement.Title="{x:Static langs:Lang.TitleDemoStr1}" Style="{StaticResource ComboBoxExtend}" Margin="0,16,0,0" Text="{x:Static langs:Lang.ContentDemoStr}"/>
|
||||
<ComboBox ItemsSource="{Binding DataList}" IsEditable="True" hc:InfoElement.Placeholder="{x:Static langs:Lang.PlsEnterContent}" hc:InfoElement.Title="{x:Static langs:Lang.TitleDemoStr2}" Style="{StaticResource ComboBoxExtend}" hc:InfoElement.Necessary="True" Margin="0,16,0,0"/>
|
||||
|
||||
|
||||
@@ -104,6 +104,29 @@
|
||||
<ToggleButton IsEnabled="False" IsChecked="True" HorizontalAlignment="Center" Margin="5,9" Style="{StaticResource ToggleButtonSwitch}"/>
|
||||
<TextBlock Style="{StaticResource TextBlockDefault}" Text="ToggleButtonSwitch"/>
|
||||
</StackPanel>
|
||||
<StackPanel>
|
||||
<ToggleButton BorderThickness="0" IsChecked="True" Margin="5" HorizontalAlignment="Center" Style="{StaticResource ToggleButtonFlip}">
|
||||
<hc:StatusSwitchElement.CheckedElement>
|
||||
<Border Background="{DynamicResource PrimaryBrush}">
|
||||
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{x:Static langs:Lang.Off}" Foreground="{DynamicResource TextIconBrush}"/>
|
||||
</Border>
|
||||
</hc:StatusSwitchElement.CheckedElement>
|
||||
<Border Background="{DynamicResource DangerBrush}">
|
||||
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{x:Static langs:Lang.On}" Foreground="{DynamicResource TextIconBrush}"/>
|
||||
</Border>
|
||||
</ToggleButton>
|
||||
<ToggleButton BorderThickness="0" IsEnabled="False" IsChecked="True" Margin="5" HorizontalAlignment="Center" Style="{StaticResource ToggleButtonFlip}">
|
||||
<hc:StatusSwitchElement.CheckedElement>
|
||||
<Border Background="{DynamicResource PrimaryBrush}">
|
||||
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{x:Static langs:Lang.Off}" Foreground="{DynamicResource TextIconBrush}"/>
|
||||
</Border>
|
||||
</hc:StatusSwitchElement.CheckedElement>
|
||||
<Border Background="{DynamicResource DangerBrush}">
|
||||
<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{x:Static langs:Lang.On}" Foreground="{DynamicResource TextIconBrush}"/>
|
||||
</Border>
|
||||
</ToggleButton>
|
||||
<TextBlock Style="{StaticResource TextBlockDefault}" Text="ToggleButtonFlip"/>
|
||||
</StackPanel>
|
||||
</WrapPanel>
|
||||
</StackPanel>
|
||||
</hc:ScrollViewer>
|
||||
|
||||
@@ -1,23 +1,24 @@
|
||||
<hc:Window x:Class="HandyControlDemo.Window.AboutWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
mc:Ignorable="d"
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||
Title="{x:Static langs:Lang.About}"
|
||||
ShowTitle="True"
|
||||
BorderThickness="1"
|
||||
BorderBrush="#262e2f"
|
||||
Style="{StaticResource WindowWin10}"
|
||||
ResizeMode="NoResize"
|
||||
ShowInTaskbar="False"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Width="340"
|
||||
Height="220">
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:hc="https://handyorg.github.io/handycontrol"
|
||||
mc:Ignorable="d"
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||
Title="{x:Static langs:Lang.About}"
|
||||
ShowTitle="True"
|
||||
BorderThickness="1"
|
||||
BorderBrush="#262e2f"
|
||||
Style="{StaticResource WindowWin10}"
|
||||
ResizeMode="NoResize"
|
||||
ShowInTaskbar="False"
|
||||
WindowStartupLocation="CenterOwner"
|
||||
Width="340"
|
||||
Height="220">
|
||||
<hc:SimplePanel>
|
||||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Top" Margin="0,30,0,0">
|
||||
<Path Data="{StaticResource LogoGeometry}" Width="40" Height="40" Fill="#f06632" VerticalAlignment="Top" Margin="0,16,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="{Binding Version}" HorizontalAlignment="Center" Margin="0,10,0,0" Foreground="{StaticResource PrimaryBrush}"/>
|
||||
</StackPanel>
|
||||
|
||||
@@ -246,7 +246,7 @@ namespace HandyControl.Controls
|
||||
{
|
||||
if (show)
|
||||
{
|
||||
for (int i = 0; i < itemsCount; i++)
|
||||
for (var i = 0; i < itemsCount; i++)
|
||||
{
|
||||
var row = (DataGridRow)generator.ContainerFromIndex(i);
|
||||
if (row != null)
|
||||
@@ -257,7 +257,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
else
|
||||
{
|
||||
for (int i = 0; i < itemsCount; i++)
|
||||
for (var i = 0; i < itemsCount; i++)
|
||||
{
|
||||
var row = (DataGridRow)generator.ContainerFromIndex(i);
|
||||
if (row != null)
|
||||
|
||||
@@ -3,13 +3,13 @@ using HandyControl.Data;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class PasswordBoxMonitor
|
||||
public class PasswordBoxAttach
|
||||
{
|
||||
/// <summary>
|
||||
/// 密码长度
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty PasswordLengthProperty = DependencyProperty.RegisterAttached(
|
||||
"PasswordLength", typeof(int), typeof(PasswordBoxMonitor), new PropertyMetadata(ValueBoxes.Int0Box));
|
||||
"PasswordLength", typeof(int), typeof(PasswordBoxAttach), new PropertyMetadata(ValueBoxes.Int0Box));
|
||||
|
||||
public static void SetPasswordLength(DependencyObject element, int value) => element.SetValue(PasswordLengthProperty, value);
|
||||
|
||||
@@ -19,7 +19,7 @@ namespace HandyControl.Controls
|
||||
/// 是否监测
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty IsMonitoringProperty = DependencyProperty.RegisterAttached(
|
||||
"IsMonitoring", typeof(bool), typeof(PasswordBoxMonitor), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.Inherits, OnIsMonitoringChanged));
|
||||
"IsMonitoring", typeof(bool), typeof(PasswordBoxAttach), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.Inherits, OnIsMonitoringChanged));
|
||||
|
||||
private static void OnIsMonitoringChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
@@ -333,7 +333,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
|
||||
var list = new List<bool>();
|
||||
for (int i = 0; i < 2; i++)
|
||||
for (var i = 0; i < 2; i++)
|
||||
{
|
||||
list.Add(false);
|
||||
}
|
||||
|
||||
@@ -135,7 +135,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public static readonly DependencyProperty ItemContentHeightProperty = DependencyProperty.Register(
|
||||
"ItemContentHeight", typeof(double), typeof(CoverView), new PropertyMetadata(ValueBoxes.Double300Box),
|
||||
value => ValidateHelper.IsInRangeOfPosDouble(value, true));
|
||||
ValidateHelper.IsInRangeOfPosDoubleIncludeZero);
|
||||
|
||||
public double ItemContentHeight
|
||||
{
|
||||
|
||||
@@ -43,7 +43,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
|
||||
internal static readonly DependencyProperty ManualHeightProperty = DependencyProperty.Register(
|
||||
"ManualHeight", typeof(double), typeof(CoverViewContent), new PropertyMetadata(ValueBoxes.Double0Box), value => ValidateHelper.IsInRangeOfPosDouble(value, true));
|
||||
"ManualHeight", typeof(double), typeof(CoverViewContent), new PropertyMetadata(ValueBoxes.Double0Box), ValidateHelper.IsInRangeOfPosDoubleIncludeZero);
|
||||
|
||||
internal double ManualHeight
|
||||
{
|
||||
@@ -53,7 +53,7 @@ namespace HandyControl.Controls
|
||||
|
||||
public static readonly DependencyProperty ContentHeightProperty = DependencyProperty.Register(
|
||||
"ContentHeight", typeof(double), typeof(CoverViewContent), new PropertyMetadata(ValueBoxes.Double300Box),
|
||||
value => ValidateHelper.IsInRangeOfPosDouble(value, true));
|
||||
ValidateHelper.IsInRangeOfPosDoubleIncludeZero);
|
||||
|
||||
public double ContentHeight
|
||||
{
|
||||
|
||||
@@ -14,11 +14,9 @@ namespace HandyControl.Controls
|
||||
private double _maxChildDesiredHeight;
|
||||
|
||||
public static readonly DependencyProperty GutterProperty = DependencyProperty.Register(
|
||||
"Gutter", typeof(double), typeof(Row), new PropertyMetadata(ValueBoxes.Double0Box, null, OnGutterCoerce), OnGutterValidate);
|
||||
"Gutter", typeof(double), typeof(Row), new PropertyMetadata(ValueBoxes.Double0Box, null, OnGutterCoerce), ValidateHelper.IsInRangeOfPosDoubleIncludeZero);
|
||||
|
||||
private static object OnGutterCoerce(DependencyObject d, object basevalue) => OnGutterValidate(basevalue) ? basevalue : .0;
|
||||
|
||||
private static bool OnGutterValidate(object value) => ValidateHelper.IsInRangeOfPosDouble(value, true);
|
||||
private static object OnGutterCoerce(DependencyObject d, object basevalue) => ValidateHelper.IsInRangeOfPosDoubleIncludeZero(basevalue) ? basevalue : .0;
|
||||
|
||||
public double Gutter
|
||||
{
|
||||
@@ -44,8 +42,6 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}
|
||||
|
||||
var itemWidth = constraint.Width / ColLayout.ColMaxCellCount;
|
||||
var childBounds = new Rect(-gutterHalf, -gutterHalf, 0, _maxChildDesiredHeight);
|
||||
_layoutStatus = ColLayout.GetLayoutStatus(constraint.Width);
|
||||
|
||||
foreach (var child in InternalChildren.OfType<Col>())
|
||||
@@ -55,15 +51,9 @@ namespace HandyControl.Controls
|
||||
|
||||
if (totalCellCount > ColLayout.ColMaxCellCount)
|
||||
{
|
||||
childBounds.X = -gutterHalf;
|
||||
childBounds.Y += _maxChildDesiredHeight;
|
||||
totalCellCount = cellCount;
|
||||
totalRowCount++;
|
||||
}
|
||||
|
||||
var childWidth = cellCount * itemWidth;
|
||||
childBounds.Width = childWidth;
|
||||
childBounds.X += childWidth + child.Offset * itemWidth;
|
||||
}
|
||||
|
||||
return new Size(0, _maxChildDesiredHeight * totalRowCount - Gutter);
|
||||
|
||||
@@ -321,7 +321,7 @@ namespace HandyControl.Controls
|
||||
|
||||
try
|
||||
{
|
||||
for (int i = 0; i < count; i++)
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
guids[i] = (Guid)ExternDllHelper.PtrToStructure((IntPtr)((long)buffer + size * i), typeof(Guid));
|
||||
}
|
||||
|
||||
@@ -153,7 +153,7 @@ namespace HandyControl.Controls
|
||||
public static readonly DependencyProperty ValueProperty = DependencyProperty.Register(
|
||||
"Value", typeof(double), typeof(NumericUpDown),
|
||||
new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.BindsTwoWayByDefault,
|
||||
OnValueChanged, CoerceValue), ArithmeticHelper.IsValidDoubleValue);
|
||||
OnValueChanged, CoerceValue), ValidateHelper.IsInRangeOfDouble);
|
||||
|
||||
private static void OnValueChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
@@ -208,7 +208,7 @@ namespace HandyControl.Controls
|
||||
/// 最大值
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty MaximumProperty = DependencyProperty.Register(
|
||||
"Maximum", typeof(double), typeof(NumericUpDown), new PropertyMetadata(double.MaxValue, OnMaximumChanged, CoerceMaximum), ArithmeticHelper.IsValidDoubleValue);
|
||||
"Maximum", typeof(double), typeof(NumericUpDown), new PropertyMetadata(double.MaxValue, OnMaximumChanged, CoerceMaximum), ValidateHelper.IsInRangeOfDouble);
|
||||
|
||||
private static void OnMaximumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
@@ -236,7 +236,7 @@ namespace HandyControl.Controls
|
||||
/// 最小值
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty MinimumProperty = DependencyProperty.Register(
|
||||
"Minimum", typeof(double), typeof(NumericUpDown), new PropertyMetadata(ValueBoxes.Double0Box, OnMinimumChanged, CoerceMinimum), ArithmeticHelper.IsValidDoubleValue);
|
||||
"Minimum", typeof(double), typeof(NumericUpDown), new PropertyMetadata(ValueBoxes.Double0Box, OnMinimumChanged, CoerceMinimum), ValidateHelper.IsInRangeOfDouble);
|
||||
|
||||
private static void OnMinimumChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
|
||||
{
|
||||
|
||||
@@ -36,11 +36,11 @@ namespace HandyControl.Controls
|
||||
|
||||
public static readonly DependencyProperty DotCountProperty = DependencyProperty.Register(
|
||||
"DotCount", typeof(int), typeof(LoadingBase),
|
||||
new FrameworkPropertyMetadata(5, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
new FrameworkPropertyMetadata(ValueBoxes.Int5Box, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
|
||||
public static readonly DependencyProperty DotIntervalProperty = DependencyProperty.Register(
|
||||
"DotInterval", typeof(double), typeof(LoadingBase),
|
||||
new FrameworkPropertyMetadata(10.0, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
new FrameworkPropertyMetadata(ValueBoxes.Double10Box, FrameworkPropertyMetadataOptions.AffectsRender));
|
||||
|
||||
public static readonly DependencyProperty DotBorderBrushProperty = DependencyProperty.Register(
|
||||
"DotBorderBrush", typeof(Brush), typeof(LoadingBase),
|
||||
|
||||
@@ -122,7 +122,7 @@ namespace HandyControl.Controls
|
||||
StretchProperty.AddOwner(typeof(AnimationPath), new FrameworkPropertyMetadata(Stretch.Uniform,
|
||||
OnPropertiesChanged));
|
||||
|
||||
StrokeThicknessProperty.AddOwner(typeof(AnimationPath), new FrameworkPropertyMetadata(1.0,
|
||||
StrokeThicknessProperty.AddOwner(typeof(AnimationPath), new FrameworkPropertyMetadata(ValueBoxes.Double1Box,
|
||||
OnPropertiesChanged));
|
||||
}
|
||||
|
||||
|
||||
@@ -85,21 +85,7 @@ namespace HandyControl.Controls
|
||||
_id = ++NextId;
|
||||
_callback = Callback;
|
||||
|
||||
Loaded += (s, e) =>
|
||||
{
|
||||
RegisterClass();
|
||||
if (Visibility == Visibility.Visible)
|
||||
{
|
||||
OnIconChanged();
|
||||
UpdateIcon(true);
|
||||
}
|
||||
|
||||
_dispatcherTimerPos = new DispatcherTimer
|
||||
{
|
||||
Interval = TimeSpan.FromMilliseconds(200)
|
||||
};
|
||||
_dispatcherTimerPos.Tick += DispatcherTimerPos_Tick;
|
||||
};
|
||||
Loaded += (s, e) => Init();
|
||||
|
||||
if (Application.Current != null) Application.Current.Exit += (s, e) => Dispose();
|
||||
}
|
||||
@@ -109,6 +95,22 @@ namespace HandyControl.Controls
|
||||
Dispose(false);
|
||||
}
|
||||
|
||||
public void Init()
|
||||
{
|
||||
RegisterClass();
|
||||
if (Visibility == Visibility.Visible)
|
||||
{
|
||||
OnIconChanged();
|
||||
UpdateIcon(true);
|
||||
}
|
||||
|
||||
_dispatcherTimerPos = new DispatcherTimer
|
||||
{
|
||||
Interval = TimeSpan.FromMilliseconds(200)
|
||||
};
|
||||
_dispatcherTimerPos.Tick += DispatcherTimerPos_Tick;
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty TextProperty = DependencyProperty.Register(
|
||||
"Text", typeof(string), typeof(NotifyIcon), new PropertyMetadata(default(string)));
|
||||
|
||||
|
||||
@@ -82,7 +82,7 @@ namespace HandyControl.Controls
|
||||
/// 最大页数
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty MaxPageCountProperty = DependencyProperty.Register(
|
||||
"MaxPageCount", typeof(int), typeof(Pagination), new PropertyMetadata(1, (o, args) =>
|
||||
"MaxPageCount", typeof(int), typeof(Pagination), new PropertyMetadata(ValueBoxes.Int1Box, (o, args) =>
|
||||
{
|
||||
if (o is Pagination pagination && args.NewValue is int value)
|
||||
{
|
||||
@@ -156,7 +156,7 @@ namespace HandyControl.Controls
|
||||
/// 当前页
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty PageIndexProperty = DependencyProperty.Register(
|
||||
"PageIndex", typeof(int), typeof(Pagination), new PropertyMetadata(1, (o, args) =>
|
||||
"PageIndex", typeof(int), typeof(Pagination), new PropertyMetadata(ValueBoxes.Int1Box, (o, args) =>
|
||||
{
|
||||
if (o is Pagination pagination && args.NewValue is int value)
|
||||
{
|
||||
@@ -312,7 +312,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
|
||||
var sub = PageIndex;
|
||||
for (int i = 0; i < MaxPageInterval - 1; i++)
|
||||
for (var i = 0; i < MaxPageInterval - 1; i++)
|
||||
{
|
||||
if (--sub > 1)
|
||||
{
|
||||
@@ -324,7 +324,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}
|
||||
var add = PageIndex;
|
||||
for (int i = 0; i < MaxPageInterval - 1; i++)
|
||||
for (var i = 0; i < MaxPageInterval - 1; i++)
|
||||
{
|
||||
if (++add < MaxPageCount)
|
||||
{
|
||||
|
||||
@@ -33,7 +33,7 @@ namespace HandyControl.Controls
|
||||
base.OnVisualChildrenChanged(visualAdded, visualRemoved);
|
||||
|
||||
var count = Items.Count;
|
||||
for (int i = 0; i < count; i++)
|
||||
for (var i = 0; i < count; i++)
|
||||
{
|
||||
var item = (RadioButton)Items[i];
|
||||
item.Style = ItemStyleSelector?.SelectStyle(item, this);
|
||||
|
||||
@@ -141,8 +141,41 @@ namespace HandyControl.Controls
|
||||
}
|
||||
else if (mode == ExpandMode.ShowOne)
|
||||
{
|
||||
var sideMenuItem = ItemsHost.Children.OfType<SideMenuItem>().FirstOrDefault(item => item.IsSelected);
|
||||
ShowSelectedOne(sideMenuItem);
|
||||
SideMenuItem sideMenuItemSelected = null;
|
||||
foreach (var sideMenuItem in ItemsHost.Children.OfType<SideMenuItem>())
|
||||
{
|
||||
if (sideMenuItemSelected != null)
|
||||
{
|
||||
sideMenuItem.IsSelected = false;
|
||||
if (sideMenuItem.ItemsHost != null)
|
||||
{
|
||||
foreach (var sideMenuSubItem in sideMenuItem.ItemsHost.Children.OfType<SideMenuItem>())
|
||||
{
|
||||
sideMenuSubItem.IsSelected = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (sideMenuItem.IsSelected)
|
||||
{
|
||||
ShowSelectedOne(sideMenuItem);
|
||||
sideMenuItemSelected = sideMenuItem;
|
||||
|
||||
if (sideMenuItem.ItemsHost != null)
|
||||
{
|
||||
foreach (var sideMenuSubItem in sideMenuItem.ItemsHost.Children.OfType<SideMenuItem>())
|
||||
{
|
||||
if (_selectedItem != null)
|
||||
{
|
||||
sideMenuSubItem.IsSelected = false;
|
||||
}
|
||||
else if (sideMenuSubItem.IsSelected)
|
||||
{
|
||||
_selectedItem = sideMenuSubItem;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -1,7 +1,6 @@
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class CompareSlider : Slider
|
||||
@@ -0,0 +1,653 @@
|
||||
// Adapted from https://referencesource.microsoft.com/#PresentationFramework/src/Framework/System/Windows/Controls/Slider.cs
|
||||
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Globalization;
|
||||
using System.Windows;
|
||||
using System.Windows.Controls;
|
||||
using System.Windows.Controls.Primitives;
|
||||
using System.Windows.Input;
|
||||
using System.Windows.Media;
|
||||
using HandyControl.Data;
|
||||
using HandyControl.Expression.Drawing;
|
||||
using HandyControl.Tools;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
[DefaultEvent("ValueChanged"), DefaultProperty("Value")]
|
||||
[TemplatePart(Name = ElementTrack, Type = typeof(Track))]
|
||||
public class RangeSlider : TwoWayRangeBase
|
||||
{
|
||||
private const string ElementTrack= "PART_Track";
|
||||
|
||||
private RangeTrack _track;
|
||||
|
||||
private readonly ToolTip _autoToolTipStart = null;
|
||||
|
||||
private readonly ToolTip _autoToolTipEnd = null;
|
||||
|
||||
private RangeThumb _thumbCurrent;
|
||||
|
||||
private object _thumbOriginalToolTip;
|
||||
|
||||
private Point _originThumbPoint;
|
||||
|
||||
private Point _previousScreenCoordPosition;
|
||||
|
||||
static RangeSlider()
|
||||
{
|
||||
InitializeCommands();
|
||||
|
||||
MinimumProperty.OverrideMetadata(typeof(RangeSlider), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.AffectsMeasure));
|
||||
MaximumProperty.OverrideMetadata(typeof(RangeSlider), new FrameworkPropertyMetadata(ValueBoxes.Double10Box, FrameworkPropertyMetadataOptions.AffectsMeasure));
|
||||
ValueStartProperty.OverrideMetadata(typeof(RangeSlider), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.AffectsMeasure));
|
||||
ValueEndProperty.OverrideMetadata(typeof(RangeSlider), new FrameworkPropertyMetadata(ValueBoxes.Double0Box, FrameworkPropertyMetadataOptions.AffectsMeasure));
|
||||
|
||||
// Register Event Handler for the Thumb
|
||||
EventManager.RegisterClassHandler(typeof(RangeSlider), Thumb.DragStartedEvent, new DragStartedEventHandler(OnThumbDragStarted));
|
||||
EventManager.RegisterClassHandler(typeof(RangeSlider), Thumb.DragDeltaEvent, new DragDeltaEventHandler(OnThumbDragDelta));
|
||||
EventManager.RegisterClassHandler(typeof(RangeSlider), Thumb.DragCompletedEvent, new DragCompletedEventHandler(OnThumbDragCompleted));
|
||||
|
||||
// Listen to MouseLeftButtonDown event to determine if slide should move focus to itself
|
||||
EventManager.RegisterClassHandler(typeof(RangeSlider), Mouse.MouseDownEvent, new MouseButtonEventHandler(OnMouseLeftButtonDown), true);
|
||||
}
|
||||
|
||||
public RangeSlider()
|
||||
{
|
||||
CommandBindings.Add(new CommandBinding(IncreaseLarge, OnIncreaseLarge));
|
||||
CommandBindings.Add(new CommandBinding(IncreaseSmall, OnIncreaseSmall));
|
||||
|
||||
CommandBindings.Add(new CommandBinding(DecreaseLarge, OnDecreaseLarge));
|
||||
CommandBindings.Add(new CommandBinding(DecreaseSmall, OnDecreaseSmall));
|
||||
|
||||
CommandBindings.Add(new CommandBinding(CenterLarge, OnCenterLarge));
|
||||
CommandBindings.Add(new CommandBinding(CenterSmall, OnCenterSmall));
|
||||
}
|
||||
|
||||
private void OnIncreaseLarge(object sender, ExecutedRoutedEventArgs e) => (sender as RangeSlider)?.OnIncreaseLarge();
|
||||
|
||||
private void OnIncreaseSmall(object sender, ExecutedRoutedEventArgs e) => (sender as RangeSlider)?.OnIncreaseSmall();
|
||||
|
||||
private void OnDecreaseLarge(object sender, ExecutedRoutedEventArgs e) => (sender as RangeSlider)?.OnDecreaseLarge();
|
||||
|
||||
private void OnDecreaseSmall(object sender, ExecutedRoutedEventArgs e) => (sender as RangeSlider)?.OnDecreaseSmall();
|
||||
|
||||
private void OnCenterLarge(object sender, ExecutedRoutedEventArgs e) => (sender as RangeSlider)?.OnCenterLarge(e.Parameter);
|
||||
|
||||
private void OnCenterSmall(object sender, ExecutedRoutedEventArgs e) => (sender as RangeSlider)?.OnCenterSmall(e.Parameter);
|
||||
|
||||
protected virtual void OnIncreaseLarge() => MoveToNextTick(LargeChange, false);
|
||||
|
||||
protected virtual void OnIncreaseSmall() => MoveToNextTick(LargeChange, false);
|
||||
|
||||
protected virtual void OnDecreaseLarge() => MoveToNextTick(-LargeChange, true);
|
||||
|
||||
protected virtual void OnDecreaseSmall() => MoveToNextTick(-LargeChange, true);
|
||||
|
||||
protected virtual void OnCenterLarge(object parameter) => MoveToNextTick(LargeChange, false, true);
|
||||
|
||||
protected virtual void OnCenterSmall(object parameter) => MoveToNextTick(LargeChange, false, true);
|
||||
|
||||
public static RoutedCommand IncreaseLarge { get; private set; }
|
||||
|
||||
public static RoutedCommand IncreaseSmall { get; private set; }
|
||||
|
||||
public static RoutedCommand DecreaseLarge { get; private set; }
|
||||
|
||||
public static RoutedCommand DecreaseSmall { get; private set; }
|
||||
|
||||
public static RoutedCommand CenterLarge { get; private set; }
|
||||
|
||||
public static RoutedCommand CenterSmall { get; private set; }
|
||||
|
||||
private static void InitializeCommands()
|
||||
{
|
||||
IncreaseLarge = new RoutedCommand(nameof(IncreaseLarge), typeof(RangeSlider));
|
||||
IncreaseSmall = new RoutedCommand(nameof(IncreaseSmall), typeof(RangeSlider));
|
||||
|
||||
DecreaseLarge = new RoutedCommand(nameof(DecreaseLarge), typeof(RangeSlider));
|
||||
DecreaseSmall = new RoutedCommand(nameof(DecreaseSmall), typeof(RangeSlider));
|
||||
|
||||
CenterLarge = new RoutedCommand(nameof(CenterLarge), typeof(RangeSlider));
|
||||
CenterSmall = new RoutedCommand(nameof(CenterSmall), typeof(RangeSlider));
|
||||
}
|
||||
|
||||
public override void OnApplyTemplate()
|
||||
{
|
||||
_thumbCurrent = null;
|
||||
|
||||
base.OnApplyTemplate();
|
||||
|
||||
_track = GetTemplateChild(ElementTrack) as RangeTrack;
|
||||
|
||||
if (_autoToolTipStart != null)
|
||||
{
|
||||
_autoToolTipStart.PlacementTarget = _track?.ThumbStart;
|
||||
}
|
||||
|
||||
if (_autoToolTipEnd != null)
|
||||
{
|
||||
_autoToolTipEnd.PlacementTarget = _track?.ThumbEnd;
|
||||
}
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty OrientationProperty = DependencyProperty.Register(
|
||||
"Orientation", typeof(Orientation), typeof(RangeSlider), new PropertyMetadata(default(Orientation)));
|
||||
|
||||
public Orientation Orientation
|
||||
{
|
||||
get => (Orientation)GetValue(OrientationProperty);
|
||||
set => SetValue(OrientationProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty IsDirectionReversedProperty = DependencyProperty.Register(
|
||||
"IsDirectionReversed", typeof(bool), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||
|
||||
public bool IsDirectionReversed
|
||||
{
|
||||
get => (bool)GetValue(IsDirectionReversedProperty);
|
||||
set => SetValue(IsDirectionReversedProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty DelayProperty = RepeatButton.DelayProperty.AddOwner(typeof(RangeSlider), new FrameworkPropertyMetadata(GetKeyboardDelay()));
|
||||
|
||||
public int Delay
|
||||
{
|
||||
get => (int)GetValue(DelayProperty);
|
||||
set => SetValue(DelayProperty, value);
|
||||
}
|
||||
|
||||
internal static int GetKeyboardDelay()
|
||||
{
|
||||
var delay = SystemParameters.KeyboardDelay;
|
||||
if (delay < 0 || delay > 3)
|
||||
delay = 0;
|
||||
return (delay + 1) * 250;
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty IntervalProperty = RepeatButton.IntervalProperty.AddOwner(typeof(RangeSlider), new FrameworkPropertyMetadata(GetKeyboardSpeed()));
|
||||
|
||||
public int Interval
|
||||
{
|
||||
get => (int)GetValue(IntervalProperty);
|
||||
set => SetValue(IntervalProperty, value);
|
||||
}
|
||||
|
||||
internal static int GetKeyboardSpeed()
|
||||
{
|
||||
var speed = SystemParameters.KeyboardSpeed;
|
||||
if (speed < 0 || speed > 31)
|
||||
speed = 31;
|
||||
return (31 - speed) * (400 - 1000 / 30) / 31 + 1000 / 30;
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty AutoToolTipPlacementProperty = DependencyProperty.Register(
|
||||
"AutoToolTipPlacement", typeof(AutoToolTipPlacement), typeof(RangeSlider), new PropertyMetadata(default(AutoToolTipPlacement)));
|
||||
|
||||
public AutoToolTipPlacement AutoToolTipPlacement
|
||||
{
|
||||
get => (AutoToolTipPlacement)GetValue(AutoToolTipPlacementProperty);
|
||||
set => SetValue(AutoToolTipPlacementProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty AutoToolTipPrecisionProperty = DependencyProperty.Register(
|
||||
"AutoToolTipPrecision", typeof(int), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.Int0Box),
|
||||
ValidateHelper.IsInRangeOfPosIntIncludeZero);
|
||||
|
||||
public int AutoToolTipPrecision
|
||||
{
|
||||
get => (int)GetValue(AutoToolTipPrecisionProperty);
|
||||
set => SetValue(AutoToolTipPrecisionProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty IsSnapToTickEnabledProperty = DependencyProperty.Register(
|
||||
"IsSnapToTickEnabled", typeof(bool), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||
|
||||
public bool IsSnapToTickEnabled
|
||||
{
|
||||
get => (bool)GetValue(IsSnapToTickEnabledProperty);
|
||||
set => SetValue(IsSnapToTickEnabledProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty TickPlacementProperty = DependencyProperty.Register(
|
||||
"TickPlacement", typeof(TickPlacement), typeof(RangeSlider), new PropertyMetadata(default(TickPlacement)));
|
||||
|
||||
public TickPlacement TickPlacement
|
||||
{
|
||||
get => (TickPlacement)GetValue(TickPlacementProperty);
|
||||
set => SetValue(TickPlacementProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty TickFrequencyProperty = DependencyProperty.Register(
|
||||
"TickFrequency", typeof(double), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.Double1Box),
|
||||
ValidateHelper.IsInRangeOfPosDoubleIncludeZero);
|
||||
|
||||
public double TickFrequency
|
||||
{
|
||||
get => (double)GetValue(TickFrequencyProperty);
|
||||
set => SetValue(TickFrequencyProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty TicksProperty = DependencyProperty.Register(
|
||||
"Ticks", typeof(DoubleCollection), typeof(RangeSlider), new PropertyMetadata(new DoubleCollection()));
|
||||
|
||||
public DoubleCollection Ticks
|
||||
{
|
||||
get => (DoubleCollection)GetValue(TicksProperty);
|
||||
set => SetValue(TicksProperty, value);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty IsMoveToPointEnabledProperty = DependencyProperty.Register(
|
||||
"IsMoveToPointEnabled", typeof(bool), typeof(RangeSlider), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||
|
||||
public bool IsMoveToPointEnabled
|
||||
{
|
||||
get => (bool)GetValue(IsMoveToPointEnabledProperty);
|
||||
set => SetValue(IsMoveToPointEnabledProperty, value);
|
||||
}
|
||||
|
||||
protected override void OnPreviewMouseLeftButtonDown(MouseButtonEventArgs e)
|
||||
{
|
||||
if (IsMoveToPointEnabled && _track.ThumbStart != null && !_track.ThumbStart.IsMouseOver && _track.ThumbEnd != null && !_track.ThumbEnd.IsMouseOver)
|
||||
{
|
||||
// Here we need to determine whether it's closer to the starting point or the end point.
|
||||
var pt = e.MouseDevice.GetPosition(_track);
|
||||
UpdateValue(pt);
|
||||
e.Handled = true;
|
||||
}
|
||||
|
||||
base.OnPreviewMouseLeftButtonDown(e);
|
||||
}
|
||||
|
||||
private void MoveToNextTick(double direction, bool isStart, bool isCenter = false, object parameter = null)
|
||||
{
|
||||
if (MathHelper.AreClose(direction, 0)) return;
|
||||
|
||||
if (isCenter)
|
||||
{
|
||||
if (parameter == null)
|
||||
{
|
||||
var pt = Mouse.GetPosition(_track);
|
||||
var newValue = _track.ValueFromPoint(pt);
|
||||
if (ValidateHelper.IsInRangeOfDouble(newValue))
|
||||
{
|
||||
var dir = (ValueStart + ValueEnd) / 2 > newValue;
|
||||
if (!dir)
|
||||
{
|
||||
isStart = false;
|
||||
direction = -Math.Abs(direction);
|
||||
}
|
||||
else
|
||||
{
|
||||
isStart = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (parameter is bool parameterValue)
|
||||
{
|
||||
isStart = parameterValue;
|
||||
}
|
||||
}
|
||||
|
||||
var value = isStart ? ValueStart : ValueEnd;
|
||||
var next = SnapToTick(Math.Max(Minimum, Math.Min(Maximum, value + direction)));
|
||||
var greaterThan = direction > 0;
|
||||
|
||||
// If the snapping brought us back to value, find the next tick point
|
||||
if (MathHelper.AreClose(next, value) &&
|
||||
!(greaterThan && MathHelper.AreClose(value, Maximum)) &&
|
||||
!(!greaterThan && MathHelper.AreClose(value, Minimum)))
|
||||
{
|
||||
// If ticks collection is available, use it.
|
||||
// Note that ticks may be unsorted.
|
||||
if (Ticks != null && Ticks.Count > 0)
|
||||
{
|
||||
foreach (var tick in Ticks)
|
||||
{
|
||||
// Find the smallest tick greater than value or the largest tick less than value
|
||||
if (greaterThan && MathHelper.GreaterThan(tick, value) && (MathHelper.LessThan(tick, next) || MathHelper.AreClose(next, value))
|
||||
|| !greaterThan && MathHelper.LessThan(tick, value) && (MathHelper.GreaterThan(tick, next) || MathHelper.AreClose(next, value)))
|
||||
{
|
||||
next = tick;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (MathHelper.GreaterThan(TickFrequency, 0.0))
|
||||
{
|
||||
// Find the current tick we are at
|
||||
var tickNumber = Math.Round((value - Minimum) / TickFrequency);
|
||||
|
||||
if (greaterThan)
|
||||
tickNumber += 1.0;
|
||||
else
|
||||
tickNumber -= 1.0;
|
||||
|
||||
next = Minimum + tickNumber * TickFrequency;
|
||||
}
|
||||
}
|
||||
|
||||
// Update if we've found a better value
|
||||
if (!MathHelper.AreClose(next, value))
|
||||
{
|
||||
SetCurrentValue(isStart ? ValueStartProperty : ValueEndProperty, next);
|
||||
}
|
||||
}
|
||||
|
||||
private double SnapToTick(double value)
|
||||
{
|
||||
if (!IsSnapToTickEnabled) return value;
|
||||
|
||||
var previous = Minimum;
|
||||
var next = Maximum;
|
||||
|
||||
if (Ticks != null && Ticks.Count > 0)
|
||||
{
|
||||
foreach (var tick in Ticks)
|
||||
{
|
||||
if (MathHelper.AreClose(tick, value))
|
||||
{
|
||||
return value;
|
||||
}
|
||||
|
||||
if (MathHelper.LessThan(tick, value) && MathHelper.GreaterThan(tick, previous))
|
||||
{
|
||||
previous = tick;
|
||||
}
|
||||
else if (MathHelper.GreaterThan(tick, value) && MathHelper.LessThan(tick, next))
|
||||
{
|
||||
next = tick;
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (MathHelper.GreaterThan(TickFrequency, 0.0))
|
||||
{
|
||||
previous = Minimum + Math.Round((value - Minimum) / TickFrequency) * TickFrequency;
|
||||
next = Math.Min(Maximum, previous + TickFrequency);
|
||||
}
|
||||
|
||||
return MathHelper.GreaterThanOrClose(value, (previous + next) * 0.5) ? next : previous;
|
||||
}
|
||||
|
||||
private void UpdateValue(Point point)
|
||||
{
|
||||
var newValue = _track.ValueFromPoint(point);
|
||||
if (ValidateHelper.IsInRangeOfDouble(newValue))
|
||||
{
|
||||
var isStart = (ValueStart + ValueEnd) / 2 > newValue;
|
||||
UpdateValue(newValue, isStart);
|
||||
}
|
||||
}
|
||||
|
||||
private void UpdateValue(double value, bool isStart)
|
||||
{
|
||||
var snappedValue = SnapToTick(value);
|
||||
|
||||
if (isStart)
|
||||
{
|
||||
if (!MathHelper.AreClose(snappedValue, ValueStart))
|
||||
{
|
||||
var start = Math.Max(Minimum, Math.Min(Maximum, snappedValue));
|
||||
if (start > ValueEnd)
|
||||
{
|
||||
SetCurrentValue(ValueEndProperty, start);
|
||||
_track.ThumbStart.CancelDrag();
|
||||
_track.ThumbEnd.StartDrag();
|
||||
_thumbCurrent = _track.ThumbEnd;
|
||||
}
|
||||
else
|
||||
{
|
||||
SetCurrentValue(ValueStartProperty, start);
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if (!MathHelper.AreClose(snappedValue, ValueEnd))
|
||||
{
|
||||
var end = Math.Max(Minimum, Math.Min(Maximum, snappedValue));
|
||||
if (end < ValueStart)
|
||||
{
|
||||
SetCurrentValue(ValueStartProperty, end);
|
||||
_track.ThumbEnd.CancelDrag();
|
||||
_track.ThumbStart.StartDrag();
|
||||
_thumbCurrent = _track.ThumbStart;
|
||||
}
|
||||
else
|
||||
{
|
||||
SetCurrentValue(ValueEndProperty, end);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnThumbDragStarted(object sender, DragStartedEventArgs e) => (sender as RangeSlider)?.OnThumbDragStarted(e);
|
||||
|
||||
protected virtual void OnThumbDragStarted(DragStartedEventArgs e)
|
||||
{
|
||||
// Show AutoToolTip if needed.
|
||||
|
||||
if (!(e.OriginalSource is RangeThumb thumb)) return;
|
||||
_thumbCurrent = thumb;
|
||||
_originThumbPoint = Mouse.GetPosition(_thumbCurrent);
|
||||
_thumbCurrent.StartDrag();
|
||||
|
||||
if (AutoToolTipPlacement == AutoToolTipPlacement.None)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var isStart = thumb.Equals(_track.ThumbStart);
|
||||
if (!isStart)
|
||||
{
|
||||
if (!thumb.Equals(_track.ThumbEnd)) return;
|
||||
}
|
||||
|
||||
// Save original tooltip
|
||||
_thumbOriginalToolTip = thumb.ToolTip;
|
||||
OnThumbDragStarted(isStart ? _autoToolTipStart : _autoToolTipEnd, isStart);
|
||||
}
|
||||
|
||||
private void OnThumbDragStarted(ToolTip toolTip, bool isStart)
|
||||
{
|
||||
if (toolTip == null)
|
||||
{
|
||||
toolTip = new ToolTip
|
||||
{
|
||||
Placement = PlacementMode.Custom,
|
||||
PlacementTarget = isStart ? _track.ThumbStart : _track.ThumbEnd,
|
||||
CustomPopupPlacementCallback = AutoToolTipCustomPlacementCallback
|
||||
};
|
||||
}
|
||||
|
||||
if (isStart)
|
||||
{
|
||||
_track.ThumbStart.ToolTip = toolTip;
|
||||
}
|
||||
else
|
||||
{
|
||||
_track.ThumbEnd.ToolTip = toolTip;
|
||||
}
|
||||
toolTip.Content = GetAutoToolTipNumber(isStart);
|
||||
toolTip.IsOpen = true;
|
||||
}
|
||||
|
||||
private CustomPopupPlacement[] AutoToolTipCustomPlacementCallback(Size popupSize, Size targetSize, Point offset)
|
||||
{
|
||||
switch (AutoToolTipPlacement)
|
||||
{
|
||||
case AutoToolTipPlacement.TopLeft:
|
||||
if (Orientation == Orientation.Horizontal)
|
||||
{
|
||||
// Place popup at top of thumb
|
||||
return new[]{new CustomPopupPlacement(
|
||||
new Point((targetSize.Width - popupSize.Width) * 0.5, -popupSize.Height),
|
||||
PopupPrimaryAxis.Horizontal)
|
||||
};
|
||||
}
|
||||
else
|
||||
{
|
||||
// Place popup at left of thumb
|
||||
return new[] {
|
||||
new CustomPopupPlacement(
|
||||
new Point(-popupSize.Width, (targetSize.Height - popupSize.Height) * 0.5),
|
||||
PopupPrimaryAxis.Vertical)
|
||||
};
|
||||
}
|
||||
|
||||
case AutoToolTipPlacement.BottomRight:
|
||||
if (Orientation == Orientation.Horizontal)
|
||||
{
|
||||
// Place popup at bottom of thumb
|
||||
return new[] {
|
||||
new CustomPopupPlacement(
|
||||
new Point((targetSize.Width - popupSize.Width) * 0.5, targetSize.Height) ,
|
||||
PopupPrimaryAxis.Horizontal)
|
||||
};
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
// Place popup at right of thumb
|
||||
return new[] {
|
||||
new CustomPopupPlacement(
|
||||
new Point(targetSize.Width, (targetSize.Height - popupSize.Height) * 0.5),
|
||||
PopupPrimaryAxis.Vertical)
|
||||
};
|
||||
}
|
||||
|
||||
default:
|
||||
return new CustomPopupPlacement[] { };
|
||||
}
|
||||
}
|
||||
|
||||
private string GetAutoToolTipNumber(bool isStart)
|
||||
{
|
||||
var format = (NumberFormatInfo)NumberFormatInfo.CurrentInfo.Clone();
|
||||
format.NumberDecimalDigits = AutoToolTipPrecision;
|
||||
return isStart ? ValueStart.ToString("N", format) : ValueEnd.ToString("N", format);
|
||||
}
|
||||
|
||||
private static void OnThumbDragDelta(object sender, DragDeltaEventArgs e) => (sender as RangeSlider)?.OnThumbDragDelta(e);
|
||||
|
||||
protected virtual void OnThumbDragDelta(DragDeltaEventArgs e)
|
||||
{
|
||||
if (!(e.OriginalSource is Thumb thumb)) return;
|
||||
var isStart = thumb.Equals(_track.ThumbStart);
|
||||
if (!isStart)
|
||||
{
|
||||
if (!thumb.Equals(_track.ThumbEnd)) return;
|
||||
}
|
||||
|
||||
// Convert to Track's co-ordinate
|
||||
OnThumbDragDelta(_track, isStart, e);
|
||||
}
|
||||
|
||||
private void OnThumbDragDelta(RangeTrack track, bool isStart, DragDeltaEventArgs e)
|
||||
{
|
||||
if (track == null || track.ThumbStart == null | _track.ThumbEnd == null) return;
|
||||
|
||||
var newValue = (isStart ? ValueStart : ValueEnd) + track.ValueFromDistance(e.HorizontalChange, e.VerticalChange);
|
||||
if (ValidateHelper.IsInRangeOfDouble(newValue))
|
||||
{
|
||||
UpdateValue(newValue, isStart);
|
||||
}
|
||||
|
||||
// Show AutoToolTip if needed
|
||||
if (AutoToolTipPlacement != AutoToolTipPlacement.None)
|
||||
{
|
||||
var toolTip = (isStart ? _autoToolTipStart : _autoToolTipEnd) ?? new ToolTip();
|
||||
|
||||
toolTip.Content = GetAutoToolTipNumber(isStart);
|
||||
|
||||
var thumb = isStart ? _track.ThumbStart : _track.ThumbEnd;
|
||||
|
||||
if (!Equals(thumb.ToolTip, toolTip))
|
||||
{
|
||||
thumb.ToolTip = toolTip;
|
||||
}
|
||||
|
||||
if (!toolTip.IsOpen)
|
||||
{
|
||||
toolTip.IsOpen = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static void OnThumbDragCompleted(object sender, DragCompletedEventArgs e) => (sender as RangeSlider)?.OnThumbDragCompleted(e);
|
||||
|
||||
protected virtual void OnThumbDragCompleted(DragCompletedEventArgs e)
|
||||
{
|
||||
// Show AutoToolTip if needed.
|
||||
|
||||
if (!(e.OriginalSource is Thumb thumb) || AutoToolTipPlacement == AutoToolTipPlacement.None)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
var isStart = thumb.Equals(_track.ThumbStart);
|
||||
if (!isStart)
|
||||
{
|
||||
if (!thumb.Equals(_track.ThumbEnd)) return;
|
||||
}
|
||||
|
||||
var toolTip = isStart ? _autoToolTipStart : _autoToolTipEnd;
|
||||
if (toolTip != null)
|
||||
{
|
||||
toolTip.IsOpen = false;
|
||||
}
|
||||
|
||||
thumb.ToolTip = _thumbOriginalToolTip;
|
||||
}
|
||||
|
||||
private static void OnMouseLeftButtonDown(object sender, MouseButtonEventArgs e)
|
||||
{
|
||||
if (e.ChangedButton != MouseButton.Left) return;
|
||||
|
||||
var slider = (RangeSlider)sender;
|
||||
|
||||
// When someone click on the Slider's part, and it's not focusable
|
||||
// Slider need to take the focus in order to process keyboard correctly
|
||||
if (!slider.IsKeyboardFocusWithin)
|
||||
{
|
||||
e.Handled = slider.Focus() || e.Handled;
|
||||
}
|
||||
|
||||
if (slider._track.ThumbStart.IsMouseOver)
|
||||
{
|
||||
slider._track.ThumbStart.StartDrag();
|
||||
slider._thumbCurrent = slider._track.ThumbStart;
|
||||
}
|
||||
|
||||
if (slider._track.ThumbEnd.IsMouseOver)
|
||||
{
|
||||
slider._track.ThumbEnd.StartDrag();
|
||||
slider._thumbCurrent = slider._track.ThumbEnd;
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnMouseMove(MouseEventArgs e)
|
||||
{
|
||||
if (_thumbCurrent == null) return;
|
||||
if (e.MouseDevice.LeftButton != MouseButtonState.Pressed) return;
|
||||
|
||||
if (!_thumbCurrent.IsDragging) return;
|
||||
|
||||
var thumbCoordPosition = e.GetPosition(_thumbCurrent);
|
||||
var screenCoordPosition = PointFromScreen(thumbCoordPosition);
|
||||
if (screenCoordPosition != _previousScreenCoordPosition)
|
||||
{
|
||||
_previousScreenCoordPosition = screenCoordPosition;
|
||||
_thumbCurrent.RaiseEvent(new DragDeltaEventArgs(thumbCoordPosition.X - _originThumbPoint.X,
|
||||
thumbCoordPosition.Y - _originThumbPoint.Y));
|
||||
}
|
||||
}
|
||||
|
||||
protected override void OnPreviewMouseLeftButtonUp(MouseButtonEventArgs e)
|
||||
{
|
||||
base.OnPreviewMouseLeftButtonUp(e);
|
||||
|
||||
_thumbCurrent = null;
|
||||
}
|
||||
}
|
||||
}
|
||||