Merge branch 'gghc' into gg

This commit is contained in:
guanguanchuangyu 2019-12-23 21:34:17 +08:00
commit adb0268b6b
87 changed files with 1916 additions and 131 deletions

6
.gitignore vendored
View File

@ -3,4 +3,8 @@
*.xml
[Bb]in/
[Oo]bj/
packages/
packages/
build/*
!build/build.cake
!build/build.nuspec
!build/build.ps1

View File

@ -1,7 +1,7 @@
<?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.2.0" Language="en-US" Publisher="HandyOrg" />
<Identity Id="5949c79d-eb43-4033-8b7b-9349d34512c6" Version="2.3.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>

View File

@ -34,8 +34,8 @@
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<ItemGroup>
<Reference Include="HandyControl, Version=2.2.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\HandyControl.2.2.0\lib\net47\HandyControl.dll</HintPath>
<Reference Include="HandyControl, Version=2.3.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\HandyControl.2.3.0\lib\net47\HandyControl.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Xaml">

View File

@ -10,5 +10,5 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("2.2.0")]
[assembly: AssemblyFileVersion("2.2.0")]
[assembly: AssemblyVersion("2.3.0")]
[assembly: AssemblyFileVersion("2.3.0")]

View File

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="HandyControl" version="2.2.0" targetFramework="net47" />
<package id="HandyControl" version="2.3.0" targetFramework="net47" />
</packages>

View File

@ -19,6 +19,6 @@
<DefineConstants>TRACE;Core</DefineConstants>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="HandyControl" Version="2.2.0" />
<PackageReference Include="HandyControl" Version="2.3.0" />
</ItemGroup>
</Project>

View File

@ -10,5 +10,5 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("2.2.0")]
[assembly: AssemblyFileVersion("2.2.0")]
[assembly: AssemblyVersion("2.3.0")]
[assembly: AssemblyFileVersion("2.3.0")]

View File

@ -49,7 +49,11 @@
## Special thanks to
[![Visual Studio Community 2019](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/vs2019_logo.png)](https://visualstudio.microsoft.com/free-developer-offers/)
[![JetBrains](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/resharper_logo.png)](https://www.jetbrains.com/?from=HandyControl)
[![Cake](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/cake_logo.png)](https://cakebuild.net/)
[![AppVeyor](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/appveyor_logo.png)](https://www.appveyor.com/)
[![Gitter](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/gitter_logo.png)](https://gitter.im/)
## Usage
@ -87,6 +91,14 @@ Step 4enjoy coding
## Latest examples
### Effects
![Effects](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Effects.png)
### RelativePanel
![RelativePanel](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/RelativePanel.png)
### Drawer
![Drawer](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Drawer.gif)
@ -99,6 +111,8 @@ Step 4enjoy coding
![Divider](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/Divider.png)
## History publication
### GeometryAnimation
![GeometryAnimation](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/GeometryAnimation.gif)
@ -107,8 +121,6 @@ Step 4enjoy coding
![SplitButton](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/SplitButton.png)
## History publication
### FloatingBlock
![FloatingBlock](https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/FloatingBlock.gif)

62
build/build.cake Normal file
View File

@ -0,0 +1,62 @@
var target = Argument("target", "Build");
Task("Clean")
.Does(() =>
{
CleanDirectory("lib");
});
Task("Build")
.IsDependentOn("Clean")
.Does(() =>
{
var vsLatest = VSWhereLatest();
var msBuildPath = vsLatest?.CombineWithFilePath("./MSBuild/Current/Bin/MSBuild.exe");
NuGetRestore("../src/Net_40/HandyControl_Net_40/HandyControl_Net_40.csproj");
var settingsNet40 = new MSBuildSettings
{
Configuration = "Release",
ToolPath = msBuildPath,
}.WithProperty("OutputPath", MakeAbsolute(Directory("lib/net40")).FullPath);
var settingsNet45 = new MSBuildSettings
{
Configuration = "Release-Net45",
ToolPath = msBuildPath,
}.WithProperty("OutputPath", MakeAbsolute(Directory("lib/net45")).FullPath);
var settingsNet462 = new MSBuildSettings
{
Configuration = "Release-Net462",
ToolPath = msBuildPath,
}.WithProperty("OutputPath", MakeAbsolute(Directory("lib/net462")).FullPath);
var settingsNet47 = new MSBuildSettings
{
Configuration = "Release-Net47",
ToolPath = msBuildPath,
}.WithProperty("OutputPath", MakeAbsolute(Directory("lib/net47")).FullPath);
var settingsNet48 = new MSBuildSettings
{
Configuration = "Release-Net48",
ToolPath = msBuildPath,
}.WithProperty("OutputPath", MakeAbsolute(Directory("lib/net48")).FullPath);
var settingsCore30 = new DotNetCoreBuildSettings
{
Framework = "netcoreapp3.0",
Configuration = "Release",
OutputDirectory = "lib/netcoreapp3.0"
};
MSBuild("../src/Net_40/HandyControl_Net_40/HandyControl_Net_40.csproj", settingsNet40);
MSBuild("../src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj", settingsNet45);
MSBuild("../src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj", settingsNet462);
MSBuild("../src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj", settingsNet47);
MSBuild("../src/Net_GE45/HandyControl_Net_GE45/HandyControl_Net_GE45.csproj", settingsNet48);
DotNetCoreBuild("../src/Core_30/HandyControl_Core_30/HandyControl_Core_30.csproj", settingsCore30);
});
RunTarget(target);

70
build/build.nuspec Normal file
View File

@ -0,0 +1,70 @@
<?xml version="1.0" encoding="utf-8"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>HandyControl</id>
<version>2.3.0</version>
<title>HandyOrg</title>
<authors>HandyOrg</authors>
<owners>HandyOrg</owners>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<projectUrl>https://github.com/NaBian/HandyControl</projectUrl>
<iconUrl>https://raw.githubusercontent.com/HandyOrg/HandyOrgResource/master/HandyControl/Resources/icon.png</iconUrl>
<description>Contains some commonly used simple WPF controls</description>
<releaseNotes>Changes are detailed at https://github.com/HandyOrg/HandyControl/releases</releaseNotes>
<copyright>Copyright © HandyOrg 2018-2019</copyright>
<language></language>
<tags>WPF C# Control</tags>
<repository type="git" url="https://github.com/HandyOrg/HandyControl" commit="1af8ac90f497e6c65e4d596604f89f54e21cbcc6" />
<dependencies>
<group targetFramework=".NETFramework4.0">
<dependency id="Microsoft.Windows.Shell" version="3.0.1" />
</group>
<group targetFramework=".NETFramework4.5" />
<group targetFramework=".NETFramework4.6.2" />
<group targetFramework=".NETFramework4.7" />
<group targetFramework=".NETFramework4.8" />
<group targetFramework=".NETCoreApp3.0" />
</dependencies>
</metadata>
<files>
<file src="lib\net40\en\HandyControl.resources.dll" target="lib\net40\en\HandyControl.resources.dll" />
<file src="lib\net40\fa\HandyControl.resources.dll" target="lib\net40\fa\HandyControl.resources.dll" />
<file src="lib\net40\fr\HandyControl.resources.dll" target="lib\net40\fr\HandyControl.resources.dll" />
<file src="lib\net40\HandyControl.dll" target="lib\net40\HandyControl.dll" />
<file src="lib\net40\HandyControl.pdb" target="lib\net40\HandyControl.pdb" />
<file src="lib\net40\HandyControl.xml" target="lib\net40\HandyControl.xml" />
<file src="lib\net40\Microsoft.Windows.Shell.dll" target="lib\net40\Microsoft.Windows.Shell.dll" />
<file src="lib\net40\Microsoft.Windows.Shell.pdb" target="lib\net40\Microsoft.Windows.Shell.pdb" />
<file src="lib\net45\en\HandyControl.resources.dll" target="lib\net45\en\HandyControl.resources.dll" />
<file src="lib\net45\fa\HandyControl.resources.dll" target="lib\net45\fa\HandyControl.resources.dll" />
<file src="lib\net45\fr\HandyControl.resources.dll" target="lib\net45\fr\HandyControl.resources.dll" />
<file src="lib\net45\HandyControl.dll" target="lib\net45\HandyControl.dll" />
<file src="lib\net45\HandyControl.pdb" target="lib\net45\HandyControl.pdb" />
<file src="lib\net45\HandyControl.xml" target="lib\net45\HandyControl.xml" />
<file src="lib\net462\en\HandyControl.resources.dll" target="lib\net462\en\HandyControl.resources.dll" />
<file src="lib\net462\fa\HandyControl.resources.dll" target="lib\net462\fa\HandyControl.resources.dll" />
<file src="lib\net462\fr\HandyControl.resources.dll" target="lib\net462\fr\HandyControl.resources.dll" />
<file src="lib\net462\HandyControl.dll" target="lib\net462\HandyControl.dll" />
<file src="lib\net462\HandyControl.pdb" target="lib\net462\HandyControl.pdb" />
<file src="lib\net462\HandyControl.xml" target="lib\net462\HandyControl.xml" />
<file src="lib\net47\en\HandyControl.resources.dll" target="lib\net47\en\HandyControl.resources.dll" />
<file src="lib\net47\fa\HandyControl.resources.dll" target="lib\net47\fa\HandyControl.resources.dll" />
<file src="lib\net47\fr\HandyControl.resources.dll" target="lib\net47\fr\HandyControl.resources.dll" />
<file src="lib\net47\HandyControl.dll" target="lib\net47\HandyControl.dll" />
<file src="lib\net47\HandyControl.pdb" target="lib\net47\HandyControl.pdb" />
<file src="lib\net47\HandyControl.xml" target="lib\net47\HandyControl.xml" />
<file src="lib\net48\en\HandyControl.resources.dll" target="lib\net48\en\HandyControl.resources.dll" />
<file src="lib\net48\fa\HandyControl.resources.dll" target="lib\net48\fa\HandyControl.resources.dll" />
<file src="lib\net48\fr\HandyControl.resources.dll" target="lib\net48\fr\HandyControl.resources.dll" />
<file src="lib\net48\HandyControl.dll" target="lib\net48\HandyControl.dll" />
<file src="lib\net48\HandyControl.pdb" target="lib\net48\HandyControl.pdb" />
<file src="lib\net48\HandyControl.xml" target="lib\net48\HandyControl.xml" />
<file src="lib\netcoreapp3.0\en\HandyControl.resources.dll" target="lib\netcoreapp3.0\en\HandyControl.resources.dll" />
<file src="lib\netcoreapp3.0\fa\HandyControl.resources.dll" target="lib\netcoreapp3.0\fa\HandyControl.resources.dll" />
<file src="lib\netcoreapp3.0\fr\HandyControl.resources.dll" target="lib\netcoreapp3.0\fr\HandyControl.resources.dll" />
<file src="lib\netcoreapp3.0\HandyControl.deps.json" target="lib\netcoreapp3.0\HandyControl.deps.json" />
<file src="lib\netcoreapp3.0\HandyControl.dll" target="lib\netcoreapp3.0\HandyControl.dll" />
<file src="lib\netcoreapp3.0\HandyControl.pdb" target="lib\netcoreapp3.0\HandyControl.pdb" />
<file src="lib\netcoreapp3.0\HandyControl.xml" target="lib\netcoreapp3.0\HandyControl.xml" />
</files>
</package>

256
build/build.ps1 Normal file
View File

@ -0,0 +1,256 @@
##########################################################################
# This is the Cake bootstrapper script for PowerShell.
# This file was downloaded from https://github.com/cake-build/resources
# Feel free to change this file to fit your needs.
##########################################################################
<#
.SYNOPSIS
This is a Powershell script to bootstrap a Cake build.
.DESCRIPTION
This Powershell script will download NuGet if missing, restore NuGet tools (including Cake)
and execute your Cake build script with the parameters you provide.
.PARAMETER Script
The build script to execute.
.PARAMETER Target
The build script target to run.
.PARAMETER Configuration
The build configuration to use.
.PARAMETER Verbosity
Specifies the amount of information to be displayed.
.PARAMETER ShowDescription
Shows description about tasks.
.PARAMETER DryRun
Performs a dry run.
.PARAMETER SkipToolPackageRestore
Skips restoring of packages.
.PARAMETER ScriptArgs
Remaining arguments are added here.
.LINK
https://cakebuild.net
#>
[CmdletBinding()]
Param(
[string]$Script = "build.cake",
[string]$Target,
[string]$Configuration,
[ValidateSet("Quiet", "Minimal", "Normal", "Verbose", "Diagnostic")]
[string]$Verbosity,
[switch]$ShowDescription,
[Alias("WhatIf", "Noop")]
[switch]$DryRun,
[switch]$SkipToolPackageRestore,
[Parameter(Position=0,Mandatory=$false,ValueFromRemainingArguments=$true)]
[string[]]$ScriptArgs
)
# Attempt to set highest encryption available for SecurityProtocol.
# PowerShell will not set this by default (until maybe .NET 4.6.x). This
# will typically produce a message for PowerShell v2 (just an info
# message though)
try {
# Set TLS 1.2 (3072), then TLS 1.1 (768), then TLS 1.0 (192), finally SSL 3.0 (48)
# Use integers because the enumeration values for TLS 1.2 and TLS 1.1 won't
# exist in .NET 4.0, even though they are addressable if .NET 4.5+ is
# installed (.NET 4.5 is an in-place upgrade).
# PowerShell Core already has support for TLS 1.2 so we can skip this if running in that.
if (-not $IsCoreCLR) {
[System.Net.ServicePointManager]::SecurityProtocol = 3072 -bor 768 -bor 192 -bor 48
}
} catch {
Write-Output 'Unable to set PowerShell to use TLS 1.2 and TLS 1.1 due to old .NET Framework installed. If you see underlying connection closed or trust errors, you may need to upgrade to .NET Framework 4.5+ and PowerShell v3'
}
[Reflection.Assembly]::LoadWithPartialName("System.Security") | Out-Null
function MD5HashFile([string] $filePath)
{
if ([string]::IsNullOrEmpty($filePath) -or !(Test-Path $filePath -PathType Leaf))
{
return $null
}
[System.IO.Stream] $file = $null;
[System.Security.Cryptography.MD5] $md5 = $null;
try
{
$md5 = [System.Security.Cryptography.MD5]::Create()
$file = [System.IO.File]::OpenRead($filePath)
return [System.BitConverter]::ToString($md5.ComputeHash($file))
}
finally
{
if ($file -ne $null)
{
$file.Dispose()
}
}
}
function GetProxyEnabledWebClient
{
$wc = New-Object System.Net.WebClient
$proxy = [System.Net.WebRequest]::GetSystemWebProxy()
$proxy.Credentials = [System.Net.CredentialCache]::DefaultCredentials
$wc.Proxy = $proxy
return $wc
}
Write-Host "Preparing to run build script..."
if(!$PSScriptRoot){
$PSScriptRoot = Split-Path $MyInvocation.MyCommand.Path -Parent
}
$TOOLS_DIR = Join-Path $PSScriptRoot "tools"
$ADDINS_DIR = Join-Path $TOOLS_DIR "Addins"
$MODULES_DIR = Join-Path $TOOLS_DIR "Modules"
$NUGET_EXE = Join-Path $TOOLS_DIR "nuget.exe"
$CAKE_EXE = Join-Path $TOOLS_DIR "Cake/Cake.exe"
$NUGET_URL = "https://github.com/HandyOrg/HandyOrgResource/blob/master/Tools/nuget.exe?raw=true"
$PACKAGES_CONFIG = Join-Path $TOOLS_DIR "packages.config"
$PACKAGES_CONFIG_MD5 = Join-Path $TOOLS_DIR "packages.config.md5sum"
$ADDINS_PACKAGES_CONFIG = Join-Path $ADDINS_DIR "packages.config"
$MODULES_PACKAGES_CONFIG = Join-Path $MODULES_DIR "packages.config"
# Make sure tools folder exists
if ((Test-Path $PSScriptRoot) -and !(Test-Path $TOOLS_DIR)) {
Write-Verbose -Message "Creating tools directory..."
New-Item -Path $TOOLS_DIR -Type Directory | Out-Null
}
# Make sure that packages.config exist.
if (!(Test-Path $PACKAGES_CONFIG)) {
Write-Verbose -Message "Downloading packages.config..."
try {
$wc = GetProxyEnabledWebClient
$wc.DownloadFile("https://cakebuild.net/download/bootstrapper/packages", $PACKAGES_CONFIG)
} catch {
Throw "Could not download packages.config."
}
}
# Try find NuGet.exe in path if not exists
if (!(Test-Path $NUGET_EXE)) {
Write-Verbose -Message "Trying to find nuget.exe in PATH..."
$existingPaths = $Env:Path -Split ';' | Where-Object { (![string]::IsNullOrEmpty($_)) -and (Test-Path $_ -PathType Container) }
$NUGET_EXE_IN_PATH = Get-ChildItem -Path $existingPaths -Filter "nuget.exe" | Select -First 1
if ($NUGET_EXE_IN_PATH -ne $null -and (Test-Path $NUGET_EXE_IN_PATH.FullName)) {
Write-Verbose -Message "Found in PATH at $($NUGET_EXE_IN_PATH.FullName)."
$NUGET_EXE = $NUGET_EXE_IN_PATH.FullName
}
}
# Try download NuGet.exe if not exists
if (!(Test-Path $NUGET_EXE)) {
Write-Verbose -Message "Downloading NuGet.exe..."
try {
$wc = GetProxyEnabledWebClient
$wc.DownloadFile($NUGET_URL, $NUGET_EXE)
} catch {
Throw "Could not download NuGet.exe."
}
}
# Save nuget.exe path to environment to be available to child processed
$env:NUGET_EXE = $NUGET_EXE
$env:NUGET_EXE_INVOCATION = if ($IsLinux -or $IsMacOS) {
"mono `"$NUGET_EXE`""
} else {
"`"$NUGET_EXE`""
}
# Restore tools from NuGet?
if(-Not $SkipToolPackageRestore.IsPresent) {
Push-Location
Set-Location $TOOLS_DIR
# Check for changes in packages.config and remove installed tools if true.
[string] $md5Hash = MD5HashFile $PACKAGES_CONFIG
if((!(Test-Path $PACKAGES_CONFIG_MD5)) -Or
($md5Hash -ne (Get-Content $PACKAGES_CONFIG_MD5 ))) {
Write-Verbose -Message "Missing or changed package.config hash..."
Get-ChildItem -Exclude packages.config,nuget.exe,Cake.Bakery |
Remove-Item -Recurse -Force
}
Write-Verbose -Message "Restoring tools from NuGet..."
$NuGetOutput = Invoke-Expression "& $env:NUGET_EXE_INVOCATION install -ExcludeVersion -OutputDirectory `"$TOOLS_DIR`""
if ($LASTEXITCODE -ne 0) {
Throw "An error occurred while restoring NuGet tools."
}
else
{
$md5Hash | Out-File $PACKAGES_CONFIG_MD5 -Encoding "ASCII"
}
Write-Verbose -Message ($NuGetOutput | Out-String)
Pop-Location
}
# Restore addins from NuGet
if (Test-Path $ADDINS_PACKAGES_CONFIG) {
Push-Location
Set-Location $ADDINS_DIR
Write-Verbose -Message "Restoring addins from NuGet..."
$NuGetOutput = Invoke-Expression "& $env:NUGET_EXE_INVOCATION install -ExcludeVersion -OutputDirectory `"$ADDINS_DIR`""
if ($LASTEXITCODE -ne 0) {
Throw "An error occurred while restoring NuGet addins."
}
Write-Verbose -Message ($NuGetOutput | Out-String)
Pop-Location
}
# Restore modules from NuGet
if (Test-Path $MODULES_PACKAGES_CONFIG) {
Push-Location
Set-Location $MODULES_DIR
Write-Verbose -Message "Restoring modules from NuGet..."
$NuGetOutput = Invoke-Expression "& $env:NUGET_EXE_INVOCATION install -ExcludeVersion -OutputDirectory `"$MODULES_DIR`""
if ($LASTEXITCODE -ne 0) {
Throw "An error occurred while restoring NuGet modules."
}
Write-Verbose -Message ($NuGetOutput | Out-String)
Pop-Location
}
# Make sure that Cake has been installed.
if (!(Test-Path $CAKE_EXE)) {
Throw "Could not find Cake.exe at $CAKE_EXE"
}
$CAKE_EXE_INVOCATION = if ($IsLinux -or $IsMacOS) {
"mono `"$CAKE_EXE`""
} else {
"`"$CAKE_EXE`""
}
# Build an array (not a string) of Cake arguments to be joined later
$cakeArguments = @()
if ($Script) { $cakeArguments += "`"$Script`"" }
if ($Target) { $cakeArguments += "-target=`"$Target`"" }
if ($Configuration) { $cakeArguments += "-configuration=$Configuration" }
if ($Verbosity) { $cakeArguments += "-verbosity=$Verbosity" }
if ($ShowDescription) { $cakeArguments += "-showdescription" }
if ($DryRun) { $cakeArguments += "-dryrun" }
$cakeArguments += $ScriptArgs
# Start Cake
Write-Host "Running build script..."
Invoke-Expression "& $CAKE_EXE_INVOCATION $($cakeArguments -join " ")"
exit $LASTEXITCODE

View File

@ -5,12 +5,12 @@
<UseWPF>true</UseWPF>
<AssemblyName>HandyControlDemo</AssemblyName>
<RootNamespace>HandyControlDemo</RootNamespace>
<Version>2.3.0</Version>
<Version>2.4.0</Version>
<ApplicationIcon>..\..\Shared\HandyControlDemo_Shared\Resources\Img\icon.ico</ApplicationIcon>
<Configurations>Debug;Release</Configurations>
<Copyright>Copyright © HandyOrg 2018-2019</Copyright>
<FileVersion>2.3.0.0</FileVersion>
<AssemblyVersion>2.3.0.0</AssemblyVersion>
<FileVersion>2.4.0.0</FileVersion>
<AssemblyVersion>2.4.0.0</AssemblyVersion>
<LangVersion>8.0</LangVersion>
<Authors>HandyOrg</Authors>
</PropertyGroup>
@ -448,6 +448,12 @@
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\View_Portrait_16x.png">
<Link>Resources\Img\LeftMainContent\View_Portrait_16x.png</Link>
</Resource>
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\TransformRelative_16x.png">
<Link>Resources\Img\LeftMainContent\TransformRelative_16x.png</Link>
</Resource>
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Effects_16x.png">
<Link>Resources\Img\LeftMainContent\Effects_16x.png</Link>
</Resource>
</ItemGroup>
<ItemGroup>
<EmbeddedResource Include="..\..\Shared\HandyControlDemo_Shared\Properties\Langs\Lang.en.resx">

View File

@ -4,8 +4,8 @@
<UseWPF>true</UseWPF>
<AssemblyName>HandyControl</AssemblyName>
<RootNamespace>HandyControl</RootNamespace>
<Version>2.3.0</Version>
<AssemblyVersion>2.3.0.0</AssemblyVersion>
<Version>2.4.0</Version>
<AssemblyVersion>2.4.0.0</AssemblyVersion>
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
<PackageRequireLicenseAcceptance>false</PackageRequireLicenseAcceptance>
<Copyright>Copyright © HandyOrg 2018-2019</Copyright>
@ -57,4 +57,12 @@
<Link>Resources\dropper.cur</Link>
</Resource>
</ItemGroup>
<ItemGroup>
<Resource Include="..\..\Shared\HandyControl_Shared\Resources\Effects\ColorComplementEffect.ps">
<Link>Resources\Effects\ColorComplementEffect.ps</Link>
</Resource>
<Resource Include="..\..\Shared\HandyControl_Shared\Resources\Effects\GrayScaleEffect.ps">
<Link>Resources\Effects\GrayScaleEffect.ps</Link>
</Resource>
</ItemGroup>
</Project>

View File

@ -3,6 +3,7 @@
xmlns:controls="clr-namespace:HandyControl.Controls">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../Basic/Sizes.xaml"/>
<ResourceDictionary Source="../../Basic/Converters.xaml"/>
<ResourceDictionary Source="BaseStyle.xaml"/>
<ResourceDictionary Source="ScrollViewerBaseStyle.xaml"/>
@ -47,7 +48,7 @@
<ControlTemplate TargetType="TreeViewItem">
<Grid>
<Grid.RowDefinitions>
<RowDefinition MinHeight="32"/>
<RowDefinition MinHeight="{StaticResource DefaultControlHeight}"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">

View File

@ -293,17 +293,11 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Button Command="{x:Static DataGrid.SelectAllCommand}" Margin="0,0,0,6" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.All}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType=DataGrid}}" Width="{Binding CellsPanelHorizontalOffset, RelativeSource={RelativeSource AncestorType=DataGrid}}" Style="{StaticResource ButtonIcon}" controls:IconElement.Geometry="{StaticResource AllGeometry}" Foreground="{DynamicResource PrimaryBrush}"/>
<Button Command="{x:Static DataGrid.SelectAllCommand}" Margin="0,0,0,6" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.All}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType=DataGrid}}" Width="{Binding CellsPanelHorizontalOffset, RelativeSource={RelativeSource AncestorType=DataGrid},Converter={StaticResource DoubleMinConverter}}" Style="{StaticResource ButtonIcon}" controls:IconElement.Geometry="{StaticResource AllGeometry}" Foreground="{DynamicResource PrimaryBrush}"/>
<DataGridColumnHeadersPresenter x:Name="PART_ColumnHeadersPresenter" Grid.ColumnSpan="2" Grid.Row="0" Grid.Column="1" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.Column}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" Grid.ColumnSpan="3" Grid.Column="0" Grid.Row="1"/>
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" x:Name="PART_VerticalScrollBar" Grid.Column="2" Maximum="{TemplateBinding ScrollableHeight}" Orientation="Vertical" Grid.Row="1" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"/>
<Grid Grid.Column="1" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding NonFrozenColumnsViewportHorizontalOffset, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" VerticalAlignment="Bottom" x:Name="PART_HorizontalScrollBar" Grid.Column="1" Maximum="{TemplateBinding ScrollableWidth}" Orientation="Horizontal" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
</Grid>
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" x:Name="PART_HorizontalScrollBar" Grid.Column="1" Maximum="{TemplateBinding ScrollableWidth}" Orientation="Horizontal" VerticalAlignment="Bottom" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
</Grid>
<ControlTemplate.Triggers>
<EventTrigger RoutedEvent="MouseEnter">

View File

@ -430,6 +430,12 @@
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>MessageToken.cs</LastGenOutput>
</Content>
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Effects_16x.png">
<Link>Resources\Img\LeftMainContent\Effects_16x.png</Link>
</Resource>
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\TransformRelative_16x.png">
<Link>Resources\Img\LeftMainContent\TransformRelative_16x.png</Link>
</Resource>
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\View_Portrait_16x.png">
<Link>Resources\Img\LeftMainContent\View_Portrait_16x.png</Link>
</Resource>

View File

@ -109,6 +109,14 @@
<Link>Resources\dropper.cur</Link>
</Resource>
</ItemGroup>
<ItemGroup>
<Resource Include="..\..\Shared\HandyControl_Shared\Resources\Effects\ColorComplementEffect.ps">
<Link>Resources\Effects\ColorComplementEffect.ps</Link>
</Resource>
<Resource Include="..\..\Shared\HandyControl_Shared\Resources\Effects\GrayScaleEffect.ps">
<Link>Resources\Effects\GrayScaleEffect.ps</Link>
</Resource>
</ItemGroup>
<Import Project="..\..\Shared\HandyControl_Shared\HandyControl_Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -3,6 +3,7 @@
xmlns:controls="clr-namespace:HandyControl.Controls">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../Basic/Sizes.xaml"/>
<ResourceDictionary Source="../../Basic/Converters.xaml"/>
<ResourceDictionary Source="BaseStyle.xaml"/>
<ResourceDictionary Source="ScrollViewerBaseStyle.xaml"/>
@ -47,7 +48,7 @@
<ControlTemplate TargetType="TreeViewItem">
<Grid>
<Grid.RowDefinitions>
<RowDefinition MinHeight="32"/>
<RowDefinition MinHeight="{StaticResource DefaultControlHeight}"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">

View File

@ -294,17 +294,11 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Button Command="{x:Static DataGrid.SelectAllCommand}" Margin="0,0,0,6" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.All}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType=DataGrid}}" Width="{Binding CellsPanelHorizontalOffset, RelativeSource={RelativeSource AncestorType=DataGrid}}" Style="{StaticResource ButtonIcon}" controls:IconElement.Geometry="{StaticResource AllGeometry}" Foreground="{DynamicResource PrimaryBrush}"/>
<Button Command="{x:Static DataGrid.SelectAllCommand}" Margin="0,0,0,6" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.All}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType=DataGrid}}" Width="{Binding CellsPanelHorizontalOffset, RelativeSource={RelativeSource AncestorType=DataGrid},Converter={StaticResource DoubleMinConverter}}" Style="{StaticResource ButtonIcon}" controls:IconElement.Geometry="{StaticResource AllGeometry}" Foreground="{DynamicResource PrimaryBrush}"/>
<DataGridColumnHeadersPresenter x:Name="PART_ColumnHeadersPresenter" Grid.ColumnSpan="2" Grid.Row="0" Grid.Column="1" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.Column}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" Grid.ColumnSpan="3" Grid.Column="0" Grid.Row="1"/>
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" x:Name="PART_VerticalScrollBar" Grid.Column="2" Maximum="{TemplateBinding ScrollableHeight}" Orientation="Vertical" Grid.Row="1" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"/>
<Grid Grid.Column="1" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding NonFrozenColumnsViewportHorizontalOffset, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" VerticalAlignment="Bottom" x:Name="PART_HorizontalScrollBar" Grid.Column="1" Maximum="{TemplateBinding ScrollableWidth}" Orientation="Horizontal" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
</Grid>
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" x:Name="PART_HorizontalScrollBar" Grid.Column="1" Maximum="{TemplateBinding ScrollableWidth}" Orientation="Horizontal" VerticalAlignment="Bottom" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
</Grid>
<ControlTemplate.Triggers>
<EventTrigger RoutedEvent="MouseEnter">

View File

@ -496,6 +496,12 @@
<Generator>TextTemplatingFileGenerator</Generator>
<LastGenOutput>MessageToken.cs</LastGenOutput>
</Content>
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\Effects_16x.png">
<Link>Resources\Img\LeftMainContent\Effects_16x.png</Link>
</Resource>
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\TransformRelative_16x.png">
<Link>Resources\Img\LeftMainContent\TransformRelative_16x.png</Link>
</Resource>
<Resource Include="..\..\Shared\HandyControlDemo_Shared\Resources\Img\LeftMainContent\View_Portrait_16x.png">
<Link>Resources\Img\LeftMainContent\View_Portrait_16x.png</Link>
</Resource>

View File

@ -180,6 +180,14 @@
<Link>Resources\dropper.cur</Link>
</Resource>
</ItemGroup>
<ItemGroup>
<Resource Include="..\..\Shared\HandyControl_Shared\Resources\Effects\ColorComplementEffect.ps">
<Link>Resources\Effects\ColorComplementEffect.ps</Link>
</Resource>
<Resource Include="..\..\Shared\HandyControl_Shared\Resources\Effects\GrayScaleEffect.ps">
<Link>Resources\Effects\GrayScaleEffect.ps</Link>
</Resource>
</ItemGroup>
<Import Project="..\..\Shared\HandyControl_Shared\HandyControl_Shared.projitems" Label="Shared" />
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
</Project>

View File

@ -3,6 +3,7 @@
xmlns:controls="clr-namespace:HandyControl.Controls">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="../../Basic/Sizes.xaml"/>
<ResourceDictionary Source="../../Basic/Converters.xaml"/>
<ResourceDictionary Source="BaseStyle.xaml"/>
<ResourceDictionary Source="ScrollViewerBaseStyle.xaml"/>
@ -47,7 +48,7 @@
<ControlTemplate TargetType="TreeViewItem">
<Grid>
<Grid.RowDefinitions>
<RowDefinition MinHeight="32"/>
<RowDefinition MinHeight="{StaticResource DefaultControlHeight}"/>
<RowDefinition/>
</Grid.RowDefinitions>
<Border x:Name="Bd" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" Padding="{TemplateBinding Padding}" SnapsToDevicePixels="true">

View File

@ -293,17 +293,11 @@
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<Button Command="{x:Static DataGrid.SelectAllCommand}" Margin="0,0,0,6" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.All}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType=DataGrid}}" Width="{Binding CellsPanelHorizontalOffset, RelativeSource={RelativeSource AncestorType=DataGrid}}" Style="{StaticResource ButtonIcon}" controls:IconElement.Geometry="{StaticResource AllGeometry}" Foreground="{DynamicResource PrimaryBrush}"/>
<Button Command="{x:Static DataGrid.SelectAllCommand}" Margin="0,0,0,6" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.All}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType=DataGrid}}" Width="{Binding CellsPanelHorizontalOffset, RelativeSource={RelativeSource AncestorType=DataGrid},Converter={StaticResource DoubleMinConverter}}" Style="{StaticResource ButtonIcon}" controls:IconElement.Geometry="{StaticResource AllGeometry}" Foreground="{DynamicResource PrimaryBrush}"/>
<DataGridColumnHeadersPresenter x:Name="PART_ColumnHeadersPresenter" Grid.ColumnSpan="2" Grid.Row="0" Grid.Column="1" Visibility="{Binding HeadersVisibility, ConverterParameter={x:Static DataGridHeadersVisibility.Column}, Converter={x:Static DataGrid.HeadersVisibilityConverter}, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<ScrollContentPresenter x:Name="PART_ScrollContentPresenter" CanContentScroll="{TemplateBinding CanContentScroll}" Grid.ColumnSpan="3" Grid.Column="0" Grid.Row="1"/>
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" x:Name="PART_VerticalScrollBar" Grid.Column="2" Maximum="{TemplateBinding ScrollableHeight}" Orientation="Vertical" Grid.Row="1" Visibility="{TemplateBinding ComputedVerticalScrollBarVisibility}" Value="{Binding VerticalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportHeight}"/>
<Grid Grid.Column="1" Grid.Row="1">
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding NonFrozenColumnsViewportHorizontalOffset, RelativeSource={RelativeSource AncestorType=DataGrid}}"/>
<ColumnDefinition Width="*"/>
</Grid.ColumnDefinitions>
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" VerticalAlignment="Bottom" x:Name="PART_HorizontalScrollBar" Grid.Column="1" Maximum="{TemplateBinding ScrollableWidth}" Orientation="Horizontal" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
</Grid>
<ScrollBar Style="{StaticResource ScrollBarBaseStyle}" Opacity="0" x:Name="PART_HorizontalScrollBar" Grid.Column="1" Maximum="{TemplateBinding ScrollableWidth}" Orientation="Horizontal" VerticalAlignment="Bottom" Grid.Row="1" Visibility="{TemplateBinding ComputedHorizontalScrollBarVisibility}" Value="{Binding HorizontalOffset, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}" ViewportSize="{TemplateBinding ViewportWidth}"/>
</Grid>
<ControlTemplate.Triggers>
<EventTrigger RoutedEvent="MouseEnter">

View File

@ -15,9 +15,10 @@ namespace HandyControlDemo
{
public partial class App
{
// ReSharper disable once NotAccessedField.Local
[SuppressMessage("代码质量", "IDE0052:删除未读的私有成员", Justification = "<挂起>")]
#pragma warning disable IDE0052
[SuppressMessage("ReSharper", "NotAccessedField.Local")]
private static Mutex AppMutex;
#pragma warning restore IDE0052
protected override void OnStartup(StartupEventArgs e)
{

View File

@ -40,7 +40,7 @@
[ "Gravatar", "GravatarDemoCtl", "User_16x", "" ],
[ "Badge", "BadgeDemoCtl", "DotLarge_16x", "" ],
[ "GotoTop", "GotoTopDemoCtl", "GoToTop_16x", "" ],
[ "SplitButton", "SplitButtonDemoCtl", "SplitButton_16x", "1" ],
[ "SplitButton", "SplitButtonDemoCtl", "SplitButton_16x", "" ],
[ "ButtonGroup", "ButtonGroupDemoCtl", "ButtonGroup_16x", "" ],
[ "ProgressButton", "ProgressButtonDemoCtl", "ProgressButton_16x", "" ],
[ "ChatBubble", "ChatBubbleDemoCtl", "Bubble_16xLG", "" ],
@ -68,6 +68,7 @@
[ "Divider", "DividerDemoCtl", "DottedSplitter_16x", "1" ],
[ "CirclePanel", "CirclePanelDemoCtl", "ColorWheel_16x", "" ],
[ "Grid", "GridDemoCtl", "GridPane_16x", "" ],
[ "RelativePanel", "RelativePanelDemoCtl", "TransformRelative_16x", "1" ],
[ "WaterfallPanel", "WaterfallPanelDemoCtl", "Panel_16x", "" ],
[ "HoneycombPanel", "HoneycombPanelDemoCtl", "PolygonHexagon_16x", "" ],
[ "TransitioningContentControl", "TransitioningContentControlDemoCtl", "TransitioningContentControl_16x", "" ],
@ -100,7 +101,8 @@
"title": "Tools",
"demoItemList": [
[ "HatchBrushGenerator", "HatchBrushGeneratorDemoCtl", "DataGenerator_16x", "" ],
[ "Morphing Animation", "GeometryAnimationDemoCtl", "Animation_16x", "1" ]
[ "Morphing Animation", "GeometryAnimationDemoCtl", "Animation_16x", "" ],
[ "Effects", "EffectsDemoCtl", "Effects_16x", "1" ]
]
}
]

View File

@ -220,6 +220,8 @@
public static readonly string BlogsView = nameof(BlogsView);
public static readonly string WebsitesView = nameof(WebsitesView);
public static readonly string NotifyIconDemo = nameof(NotifyIconDemo);
public static readonly string NotifyIconContextDemo = nameof(NotifyIconContextDemo);

View File

@ -120,6 +120,7 @@ var messageList = new List<string>
"OverView",
"ProjectsView",
"BlogsView",
"WebsitesView",
"NotifyIconDemo",
"NotifyIconContextDemo"
};

View File

@ -182,6 +182,9 @@
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\RateDemoCtl.xaml.cs">
<DependentUpon>RateDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\RelativePanelDemoCtl.xaml.cs">
<DependentUpon>RelativePanelDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Controls\RunningBlockDemoCtl.xaml.cs">
<DependentUpon>RunningBlockDemoCtl.xaml</DependentUpon>
</Compile>
@ -263,6 +266,9 @@
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Main\UnderConstruction.xaml.cs">
<DependentUpon>UnderConstruction.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Main\WebsitesView.xaml.cs">
<DependentUpon>WebsitesView.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Styles\BorderDemoCtl.xaml.cs">
<DependentUpon>BorderDemoCtl.xaml</DependentUpon>
</Compile>
@ -344,6 +350,9 @@
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Styles\TreeViewDemoCtl.xaml.cs">
<DependentUpon>TreeViewDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Tools\EffectsDemoCtl.xaml.cs">
<DependentUpon>EffectsDemoCtl.xaml</DependentUpon>
</Compile>
<Compile Include="$(MSBuildThisFileDirectory)UserControl\Tools\GeometryAnimationDemoCtl.xaml.cs">
<DependentUpon>GeometryAnimationDemoCtl.xaml</DependentUpon>
</Compile>
@ -640,6 +649,10 @@
<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\RunningBlockDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -748,6 +761,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Main\WebsitesView.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Styles\BorderDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
@ -856,6 +873,10 @@
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Tools\EffectsDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<Page Include="$(MSBuildThisFileDirectory)UserControl\Tools\GeometryAnimationDemoCtl.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>

View File

@ -13,5 +13,5 @@ using System.Windows;
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: ThemeInfo(ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly)]
[assembly: AssemblyVersion("2.3.0")]
[assembly: AssemblyVersion("2.4.0")]
#endif

View File

@ -474,6 +474,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 示例 的本地化字符串。
/// </summary>
public static string Demo {
get {
return ResourceManager.GetString("Demo", resourceCulture);
}
}
/// <summary>
/// 查找类似 对话框 的本地化字符串。
/// </summary>
@ -501,6 +510,33 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 中文文档 的本地化字符串。
/// </summary>
public static string Doc_cn {
get {
return ResourceManager.GetString("Doc_cn", resourceCulture);
}
}
/// <summary>
/// 查找类似 英文文档 的本地化字符串。
/// </summary>
public static string Doc_en {
get {
return ResourceManager.GetString("Doc_en", resourceCulture);
}
}
/// <summary>
/// 查找类似 文献资料 的本地化字符串。
/// </summary>
public static string Documentation {
get {
return ResourceManager.GetString("Documentation", resourceCulture);
}
}
/// <summary>
/// 查找类似 在这里拖拽 的本地化字符串。
/// </summary>
@ -519,6 +555,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 效果 的本地化字符串。
/// </summary>
public static string Effects {
get {
return ResourceManager.GetString("Effects", resourceCulture);
}
}
/// <summary>
/// 查找类似 邮箱 的本地化字符串。
/// </summary>
@ -1752,6 +1797,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 VS 插件 的本地化字符串。
/// </summary>
public static string Vsix {
get {
return ResourceManager.GetString("Vsix", resourceCulture);
}
}
/// <summary>
/// 查找类似 警告 的本地化字符串。
/// </summary>
@ -1770,6 +1824,15 @@ namespace HandyControlDemo.Properties.Langs {
}
}
/// <summary>
/// 查找类似 网站 的本地化字符串。
/// </summary>
public static string Website {
get {
return ResourceManager.GetString("Website", resourceCulture);
}
}
/// <summary>
/// 查找类似 窗口 的本地化字符串。
/// </summary>

View File

@ -690,4 +690,25 @@
<data name="Drawer" xml:space="preserve">
<value>Drawer</value>
</data>
<data name="Documentation" xml:space="preserve">
<value>Documentation</value>
</data>
<data name="Effects" xml:space="preserve">
<value>Effects</value>
</data>
<data name="Website" xml:space="preserve">
<value>Website</value>
</data>
<data name="Vsix" xml:space="preserve">
<value>Vsix</value>
</data>
<data name="Doc_en" xml:space="preserve">
<value>English document</value>
</data>
<data name="Doc_cn" xml:space="preserve">
<value>Chinese document</value>
</data>
<data name="Demo" xml:space="preserve">
<value>Demo</value>
</data>
</root>

View File

@ -690,4 +690,25 @@
<data name="Drawer" xml:space="preserve">
<value>Drawer</value>
</data>
<data name="Documentation" xml:space="preserve">
<value>مستندات</value>
</data>
<data name="Effects" xml:space="preserve">
<value>Effects</value>
</data>
<data name="Website" xml:space="preserve">
<value>Website</value>
</data>
<data name="Vsix" xml:space="preserve">
<value>Vsix</value>
</data>
<data name="Doc_en" xml:space="preserve">
<value>English document</value>
</data>
<data name="Doc_cn" xml:space="preserve">
<value>Chinese document</value>
</data>
<data name="Demo" xml:space="preserve">
<value>Demo</value>
</data>
</root>

View File

@ -690,4 +690,25 @@
<data name="Drawer" xml:space="preserve">
<value>Drawer</value>
</data>
<data name="Documentation" xml:space="preserve">
<value>Documentation</value>
</data>
<data name="Effects" xml:space="preserve">
<value>Effects</value>
</data>
<data name="Website" xml:space="preserve">
<value>Website</value>
</data>
<data name="Vsix" xml:space="preserve">
<value>Vsix</value>
</data>
<data name="Doc_en" xml:space="preserve">
<value>English document</value>
</data>
<data name="Doc_cn" xml:space="preserve">
<value>Chinese document</value>
</data>
<data name="Demo" xml:space="preserve">
<value>Demo</value>
</data>
</root>

View File

@ -690,4 +690,25 @@
<data name="Drawer" xml:space="preserve">
<value>抽屉</value>
</data>
<data name="Documentation" xml:space="preserve">
<value>文献资料</value>
</data>
<data name="Effects" xml:space="preserve">
<value>效果</value>
</data>
<data name="Website" xml:space="preserve">
<value>网站</value>
</data>
<data name="Vsix" xml:space="preserve">
<value>VS 插件</value>
</data>
<data name="Doc_en" xml:space="preserve">
<value>英文文档</value>
</data>
<data name="Doc_cn" xml:space="preserve">
<value>中文文档</value>
</data>
<data name="Demo" xml:space="preserve">
<value>示例</value>
</data>
</root>

Binary file not shown.

After

Width:  |  Height:  |  Size: 369 B

Binary file not shown.

After

Width:  |  Height:  |  Size: 169 B

View File

@ -46,7 +46,7 @@
</DrawingBrush.Drawing>
</DrawingBrush>
<DrawingBrush x:Key="BlogDrawingBrush" RenderOptions.CachingHint="Cache" Viewport="0,0,120,100" ViewportUnits="Absolute" Stretch="Uniform" TileMode="Tile">
<DrawingBrush x:Key="BlogDrawingBrush" RenderOptions.CachingHint="Cache" Viewport="0,0,160,100" ViewportUnits="Absolute" Stretch="Uniform" TileMode="Tile">
<DrawingBrush.Transform>
<TransformGroup>
<RotateTransform Angle="20"/>
@ -55,7 +55,7 @@
<DrawingBrush.Drawing>
<GeometryDrawing>
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="0,0,120,100"></RectangleGeometry>
<RectangleGeometry Rect="0,0,160,100"></RectangleGeometry>
</GeometryDrawing.Geometry>
<GeometryDrawing.Brush>
<VisualBrush>
@ -70,7 +70,7 @@
</DrawingBrush.Drawing>
</DrawingBrush>
<DrawingBrush x:Key="ProjectDrawingBrush" RenderOptions.CachingHint="Cache" Viewport="0,0,200,100" ViewportUnits="Absolute" Stretch="Uniform" TileMode="Tile">
<DrawingBrush x:Key="WebsiteDrawingBrush" RenderOptions.CachingHint="Cache" Viewport="0,0,320,100" ViewportUnits="Absolute" Stretch="Uniform" TileMode="Tile">
<DrawingBrush.Transform>
<TransformGroup>
<RotateTransform Angle="20"/>
@ -79,7 +79,31 @@
<DrawingBrush.Drawing>
<GeometryDrawing>
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="0,0,200,100"></RectangleGeometry>
<RectangleGeometry Rect="0,0,320,100"></RectangleGeometry>
</GeometryDrawing.Geometry>
<GeometryDrawing.Brush>
<VisualBrush>
<VisualBrush.Visual>
<StackPanel>
<TextBlock Text="Website" Foreground="{DynamicResource DarkMaskBrush}"/>
</StackPanel>
</VisualBrush.Visual>
</VisualBrush>
</GeometryDrawing.Brush>
</GeometryDrawing>
</DrawingBrush.Drawing>
</DrawingBrush>
<DrawingBrush x:Key="ProjectDrawingBrush" RenderOptions.CachingHint="Cache" Viewport="0,0,240,100" ViewportUnits="Absolute" Stretch="Uniform" TileMode="Tile">
<DrawingBrush.Transform>
<TransformGroup>
<RotateTransform Angle="20"/>
</TransformGroup>
</DrawingBrush.Transform>
<DrawingBrush.Drawing>
<GeometryDrawing>
<GeometryDrawing.Geometry>
<RectangleGeometry Rect="0,0,240,100"></RectangleGeometry>
</GeometryDrawing.Geometry>
<GeometryDrawing.Brush>
<VisualBrush>

View File

@ -9,6 +9,7 @@
<Geometry x:Key="NugetGeometry">M449.722947 199.412211H706.021053c130.967579 0 237.136842 106.169263 237.136842 237.136842v256.298105c0 130.967579-106.169263 237.136842-237.136842 237.136842H449.722947c-130.965895 0-237.136842-106.169263-237.136842-237.136842V436.549053c0-130.967579 106.170947-237.136842 237.136842-237.136842z m-201.205894-21.557895c0-64.299789-70.085053-104.704-125.850948-72.55579s-55.764211 112.96 0 145.111579 125.850947-8.257684 125.850948-72.555789z m239.528421 234.74021c0-68.003368-74.088421-110.736842-133.037474-76.734315s-58.950737 119.467789 0 153.470315 133.039158-8.730947 133.039158-76.736zM835.368421 692.847158c0-117.596632-128.154947-191.494737-230.123789-132.695579s-101.970526 206.593684 0 265.391158S835.368421 810.443789 835.368421 692.847158z</Geometry>
<Geometry x:Key="EmailGeometry">M430.079734 481.464543c45.196365 45.596478 118.486578 45.596478 163.68499 0l360.684736-324.939627c0.547469 3.751441 1.13894 7.490601 1.13894 11.401678l0 404.753417 0 116.754121c0 42.995233-34.547841 77.838809-77.145008 77.838809L145.397996 767.272941c-42.597167 0-77.145008-34.844599-77.145008-77.838809L68.252988 494.839155 68.252988 167.926594c0-3.911076 0.593518-7.65126 1.139963-11.401678L430.079734 481.464543zM910.960992 74.226538 562.044278 387.28558c-38.470173 38.811957-62.276369 38.811957-100.770078 0L112.538611 74.408687c10.011005-4.789073 21.069875-7.673773 32.859385-7.673773l733.044372 0C890.095779 66.735937 901.065622 69.539796 910.960992 74.226538z</Geometry>
<Geometry x:Key="GitterGeometry">M260.8 645H160V0h100.8v645zM461.8 152.2h-100.8V1024h100.8V152.2z m201.2 0h-100.8V1024h100.8V152.2zM864 152h-100.8v494H864V152z</Geometry>
<Geometry x:Key="WebsiteGeometry">M698.026667 597.333333C701.44 569.173333 704 541.013333 704 512 704 482.986667 701.44 454.826667 698.026667 426.666667L842.24 426.666667C849.066667 453.973333 853.333333 482.56 853.333333 512 853.333333 541.44 849.066667 570.026667 842.24 597.333333M622.506667 834.56C648.106667 787.2 667.733333 736 681.386667 682.666667L807.253333 682.666667C766.293333 753.066667 701.013333 807.68 622.506667 834.56M611.84 597.333333 412.16 597.333333C407.893333 569.173333 405.333333 541.013333 405.333333 512 405.333333 482.986667 407.893333 454.4 412.16 426.666667L611.84 426.666667C615.68 454.4 618.666667 482.986667 618.666667 512 618.666667 541.013333 615.68 569.173333 611.84 597.333333M512 851.626667C476.586667 800.426667 448 743.68 430.506667 682.666667L593.493333 682.666667C576 743.68 547.413333 800.426667 512 851.626667M341.333333 341.333333 216.746667 341.333333C257.28 270.506667 322.986667 215.893333 401.066667 189.44 375.466667 236.8 356.266667 288 341.333333 341.333333M216.746667 682.666667 341.333333 682.666667C356.266667 736 375.466667 787.2 401.066667 834.56 322.986667 807.68 257.28 753.066667 216.746667 682.666667M181.76 597.333333C174.933333 570.026667 170.666667 541.44 170.666667 512 170.666667 482.56 174.933333 453.973333 181.76 426.666667L325.973333 426.666667C322.56 454.826667 320 482.986667 320 512 320 541.013333 322.56 569.173333 325.973333 597.333333M512 171.946667C547.413333 223.146667 576 280.32 593.493333 341.333333L430.506667 341.333333C448 280.32 476.586667 223.146667 512 171.946667M807.253333 341.333333 681.386667 341.333333C667.733333 288 648.106667 236.8 622.506667 189.44 701.013333 216.32 766.293333 270.506667 807.253333 341.333333M512 85.333333C276.053333 85.333333 85.333333 277.333333 85.333333 512 85.333333 747.52 276.48 938.666667 512 938.666667 747.52 938.666667 938.666667 747.52 938.666667 512 938.666667 276.48 747.52 85.333333 512 85.333333Z</Geometry>
<Geometry x:Key="FaceBookGeometry">m 41.416254,90 c -0.327378,-7.4702 0.20833,-32.7284 0,-39.901 -5.386902,-0.2083 -4.521603,0.3274 -9.848987,0 0.20833,-5.50595 0.36436,-7.66666 0.126269,-13.32142 4.646472,0.0181 3.439989,-0.009 9.848987,-0.1894 0.09586,-3.7736 0.133082,-3.0791 0.126269,-7.38674 0.18259,-3.73943 -0.486609,-10.54308 4.293149,-14.96288 4.779758,-4.4198 13.606811,-3.64808 22.223356,-3.53554 -0.04417,5.73754 -0.03936,9.37986 0,12.87945 -5.049924,0.46388 -7.309188,-0.33689 -10.85914,1.26269 -1.403378,3.17794 -1.569601,4.80531 -1.262691,11.93242 3.147964,-0.13336 8.201788,-0.1378 12.626907,0 -0.995158,6.00899 -0.948285,7.62376 -1.767767,13.06882 -3.676625,0.088 -5.605721,-0.1488 -11.111678,0 -0.148814,6.756 0.357147,33.0107 0,40.1536 -6.428576,0.1786 -8.174438,-0.03 -14.394674,0 z</Geometry>
<Geometry x:Key="TwitterGeometry">m 10.44335,90 c 11.073313,0.3952 19.483106,-1.8358 23.901837,-7.1603 -7.9736,-1.4292 -11.832311,-4.1933 -15.078321,-11.0837 3.459698,0.8219 5.795894,0.6358 7.606781,-0.607 -7.19593,-1.719 -12.734543,-6.7971 -13.741664,-15.836 2.766355,1.55307 5.466848,2.66623 7.828682,2.0203 -4.336544,-2.92911 -9.838998,-10.47636 -5.555839,-22.47589 8.400675,11.87052 23.824269,17.67568 33.840111,17.67767 -0.936406,-9.74688 5.88057,-19.46521 15.302849,-19.97853 8.13118,-0.50719 10.57457,4.01944 12.476346,4.82624 3.644547,0.13419 7.393301,-1.74401 10.354063,-3.53553 -1.380842,4.47157 -5.06769,5.62903 -6.313453,8.58629 5.42317,0.41513 5.891376,-1.53111 8.333758,-2.0203 -2.071414,3.75017 -5.393863,5.00034 -7.323606,8.08122 -1.633654,16.12573 -5.16049,27.57123 -14.647212,36.36553 -13.825764,11.3764 -34.755458,17.369 -56.984332,5.14 z</Geometry>
<Geometry x:Key="ThumbsUpGeometry">M68.191078 915.462005l161.384597 0L229.575676 431.30719 68.191078 431.30719 68.191078 915.462005zM955.808922 471.653083c0-44.582381-36.109406-80.69281-80.69281-80.69281L620.329241 390.960273 658.859789 206.578915c0.807389-4.034896 1.412163-8.271384 1.412163-12.709463 0-16.743336-6.859221-31.873941-17.752316-42.767036l-42.968627-42.565445L333.871043 374.216937c-14.524808 14.7264-23.602557 34.899858-23.602557 57.090253l0 403.462005c0 44.582381 36.109406 80.69281 80.69281 80.69281l363.116111 0c33.487695 0 62.133106-20.37505 74.236771-49.222051l121.643478-284.441261c3.63069-9.279341 5.850242-19.164478 5.850242-29.452799L955.807898 475.083206l-0.403183-0.403183L955.808922 471.653083z</Geometry>
@ -22,5 +23,9 @@
<Geometry x:Key="QqGeometry">M936.194300839506 691.6934192494618c-5.891587367822223-94.26540047423211-70.69904970840491-170.8560375504593-106.04857520987652-212.09715041975304 5.891587367822223-11.783174735644446 17.674762103466666-79.53643140740742-29.457938133649378-126.66913164452346V349.981342854005c0-182.63921228610366-129.61492468116543-315.1999312984493-294.57937486380246-315.1999312984493s-294.57937615834066 132.5607190123457-294.57937615834066 315.1999312984493v2.9457943311802466c-47.132700237116055 47.132700237116055-35.349525501471604 114.885956908879-29.45793683911111 126.66913164452346-35.349525501471604 41.24111286929382-100.15698784205432 117.83174994552098-106.04857520987652 212.09715041975304 0 23.56634947128889 2.9457943311802466 58.91587497276049 14.728969066824689 76.59063707622718 14.728969066824689 20.62055643464691 55.97008193611851-2.9457943311802466 82.48222444404936-64.80746234058272 8.837381699002469 29.457938133649378 26.51214380246913 73.64484403958517 67.75325667176295 126.66913164452346-70.69904970840491 14.728969066824689-88.37381310640988 85.42801877522965-64.80746234058272 123.72333731334321 17.674762103466666 26.51214380246913 53.02428760493826 47.132700237116055 120.77754298216297 47.132700237116055 114.885956908879 0 167.9102445138173-32.40373117029136 191.4765952796444-53.02428760493826 5.891587367822223-5.891587367822223 11.783174735644446-5.891587367822223 20.620555140108642-5.891587367822223 8.837381699002469 0 14.728969066824689 2.9457943311802466 20.62055643464691 5.891587367822223 23.56634947128889 20.62055643464691 73.64484403958517 53.02428760493826 191.4765939851062 53.02428760493826 64.80746234058272 0 103.10278087869627-20.62055643464691 120.77754427670124-47.132700237116055 23.56634947128889-38.29531853811359 2.9457943311802466-106.04857520987652-64.80746234058272-123.72333731334321 41.24111286929382-55.97008193611851 58.91587497276049-100.15698784205432 67.75325667176295-126.66913164452346 29.457938133649378 61.86166930394074 67.75325667176295 85.42801877522965 82.48222444404936 64.80746234058272 5.891587367822223-17.674762103466666 11.783174735644446-53.02428760493826 8.837381699002469-76.59063707622718z m0 0</Geometry>
<Geometry x:Key="ProjectGeometry">M838.4 325.12 554.24 479.36C528 493.44 512 521.6 512 552.96l0 298.24c0 32 31.36 53.12 57.6 38.4l284.16-154.24c25.6-14.08 42.24-42.24 42.24-73.6L896 364.16C896 331.52 864.64 311.04 838.4 325.12zM405.76 478.72 121.6 325.12C95.36 311.04 64 331.52 64 363.52l0 299.52c0 31.36 16 59.52 42.24 73.6l284.16 153.6C416.64 904.32 448 883.2 448 851.2L448 552.32C448 520.96 432 492.8 405.76 478.72zM812.16 255.36c13.44-7.04 19.84-19.2 18.56-30.72 1.28-12.16-5.12-23.68-18.56-30.72L522.88 42.88c-12.8-7.04-28.16-10.24-43.52-10.24-15.36 0-30.72 3.2-43.52 10.24L146.56 193.28C133.12 200.32 127.36 212.48 128 224 127.36 236.16 133.12 248.32 146.56 255.36l289.28 150.4c12.8 7.04 28.16 10.24 43.52 10.24 15.36 0 30.72-3.2 43.52-10.24L812.16 255.36z</Geometry>
<Geometry x:Key="BlogGeometry">M1137.575865 0l0 795.939663-267.130435 228.060337-870.44543 0 0-1024 1137.575865 0zM795.939663 682.363798l-626.030169 0 0 113.575865 626.030169 0 0-113.575865zM966.757764 455.212067l-796.84827 0 0 113.575865 796.84827 0 0-113.575865zM966.757764 227.15173l-796.84827 0 0 114.484472 796.84827 0 0-114.484472z</Geometry>
<Geometry x:Key="VisualStudioGeometry">M23.063,0L11,12L3,6L0,7v15l3,2l8-6l11.875,12L30,27V2.938L23.063,0z M3,19v-8l5,4L3,19z M23,21l-8-6l8-6V21z</Geometry>
<Geometry x:Key="CodeGeometry">M288.752 319.495c-12.497-12.497-32.758-12.497-45.255 0L73.619 489.372a32 32 0 0 0 0 45.254l169.878 169.879c6.249 6.248 14.438 9.372 22.627 9.372s16.379-3.124 22.627-9.372c12.497-12.497 12.497-32.759 0-45.255L141.502 512l147.25-147.25c12.497-12.497 12.497-32.758 0-45.255zM950.38 489.372L780.504 319.495c-12.498-12.497-32.759-12.497-45.255 0-12.497 12.497-12.497 32.758 0 45.255L882.499 512l-147.25 147.251c-12.496 12.496-12.496 32.758 0.001 45.255 6.248 6.248 14.438 9.372 22.627 9.372s16.379-3.124 22.628-9.373l169.877-169.878c12.496-12.497 12.496-32.758-0.002-45.255zM600.417 312.63c-16.289-6.858-35.052 0.785-41.91 17.074L415.451 669.46c-6.858 16.288 0.786 35.052 17.074 41.91a31.892 31.892 0 0 0 12.404 2.517c12.488 0 24.355-7.359 29.506-19.591L617.491 354.54c6.858-16.288-0.786-35.052-17.074-41.91z</Geometry>
<Geometry x:Key="WikiGeometry">M638.72 808.533333 529.493333 551.253333C485.973333 636.16 438.186667 725.333333 397.226667 808.533333 396.8 808.96 377.173333 808.533333 377.173333 808.533333 314.453333 661.333333 249.6 516.266667 186.453333 370.346667 171.946667 334.506667 120.746667 277.333333 85.333333 277.333333 85.333333 273.066667 85.333333 263.68 85.333333 258.133333L301.226667 258.133333 301.226667 277.333333C275.626667 277.333333 232.106667 294.4 243.2 322.133333 273.92 387.84 381.44 642.56 410.88 707.413333 430.933333 667.306667 487.68 561.493333 512 516.693333 492.8 479.146667 432.213333 338.346667 414.293333 303.36 400.64 280.32 366.08 277.333333 339.626667 277.333333 339.626667 270.933333 340.053333 266.666667 339.626667 258.56L529.92 258.986667 529.92 276.053333C503.893333 277.333333 479.573333 286.293333 490.666667 311.04 516.266667 363.946667 531.2 401.92 554.666667 450.986667 561.92 436.48 600.32 357.546667 618.666667 316.16 629.76 288.426667 613.12 277.333333 567.04 277.333333 567.466667 272.213333 567.466667 263.253333 567.466667 258.986667 626.773333 258.56 715.946667 258.56 731.733333 258.133333L731.733333 276.053333C701.44 277.333333 670.293333 293.546667 654.08 318.293333L576 482.133333C583.68 503.893333 659.626667 672.426667 667.733333 691.2L832 314.453333C819.2 283.733333 782.506667 277.333333 768 277.333333 768 271.786667 768 264.533333 768 258.133333L938.666667 259.413333 938.666667 260.266667 938.666667 277.333333C901.12 277.333333 877.653333 298.666667 864 330.666667 829.866667 407.04 725.333333 650.24 657.066667 808.533333 657.066667 808.533333 638.72 808.533333 638.72 808.533333Z</Geometry>
<Geometry x:Key="DocGeometry">M173.826977 510.432295c0-122.019031-0.050142-244.038062 0.022513-366.057093 0.032746-54.232159 27.618011-81.962733 81.740676-82.012875 117.26475-0.10847 234.532571-0.400113 351.790158 0.567935 10.968819 0.090051 24.65554 5.861498 32.362059 13.658068 66.276473 67.050092 131.747603 134.908596 196.58633 203.352431 7.161097 7.559163 12.495592 20.287045 12.535501 30.641881 0.738827 189.363835 0.623193 378.731764 0.480954 568.098669-0.036839 49.259914-28.894074 77.959559-78.538751 78.007655-172.727946 0.166799-345.455893 0.165776-518.183839 0.002047-50.561559-0.048095-78.714759-28.893051-78.760808-80.201623C173.752276 754.470357 173.826977 632.451326 173.826977 510.432295zM425.726078 715.13242c-0.409322 52.42193 32.43983 88.344071 81.254605 88.856747 48.829102 0.512676 83.016739-35.294854 83.205027-87.148849 0.190335-52.300156-32.965809-88.35942-81.524758-88.665389C459.317127 627.863844 426.136424 662.654208 425.726078 715.13242zM265.914302 633.581056c0 56.69935 0 110.830201 0 166.16446 23.783683 0 45.88505 0.218988 67.980277-0.049119 36.362162-0.441045 61.114916-17.009396 71.76958-47.599088 13.557784-38.924521 4.252861-85.525885-22.836101-104.649432-9.880021-6.974855-22.768563-12.386098-34.668591-13.255908C321.448106 632.240525 294.495244 633.581056 265.914302 633.581056zM758.306732 689.51088c-9.967002-45.812395-41.170678-66.920132-86.082564-60.683081-42.587957 5.913687-71.66418 46.171576-67.992557 94.137007 3.773953 49.296753 35.82902 80.999802 81.923848 81.025385 42.137703 0.023536 68.915579-25.63382 71.465658-69.621661-10.092869 0-20.128433 0-30.109762 0-16.044418 36.365232-36.768415 47.330982-62.482053 33.178657-19.942191-10.975982-28.691459-39.623439-21.979594-69.791529 4.77884-21.481244 16.022928-36.523845 39.027875-38.340213 21.590737-1.704828 35.721573 9.087982 40.968064 30.095435C735.017306 689.51088 745.964636 689.51088 758.306732 689.51088zM635.406634 159.644977c0 32.664957-0.671289 69.714781 0.62524 106.695021 0.230244 6.566556 8.422833 18.209734 13.30912 18.408255 37.929868 1.542122 75.950809 0.851391 113.944122 0.851391 1.113357-2.461051 2.226714-4.92108 3.340071-7.382131C722.585159 238.422158 678.54513 198.626803 635.406634 159.644977zM553.603537 717.1381c-0.353041 34.149774-17.751293 55.144948-45.725414 55.175647-29.049616 0.031722-45.502333-21.023826-44.98454-57.571207 0.49528-34.968419 17.328667-55.873542 44.977377-55.858192C535.765263 658.899698 553.965787 682.0827 553.603537 717.1381zM298.449299 770.413468c0-37.08564 0-71.501474 0-107.650789 25.056676-1.242294 50.77236-6.163373 66.627467 18.401092 13.642718 21.135366 14.034645 45.815465 2.095731 67.677379C352.412328 775.868713 325.439 771.676228 298.449299 770.413468z</Geometry>
</ResourceDictionary>

View File

@ -185,6 +185,19 @@ namespace HandyControlDemo.Service
};
}
internal List<AvatarModel> GetWebsiteDataList()
{
return new List<AvatarModel>
{
new AvatarModel
{
DisplayName = "Dotnet9",
AvatarUri = "https://pic.cnblogs.com/avatar/1663243/20191124121029.png",
Link = "https://dotnet9.com/"
}
};
}
internal ObservableCollection<CardModel> GetCardDataList()
{
return new ObservableCollection<CardModel>

View File

@ -20,7 +20,7 @@ namespace HandyControlDemo.Tools.Converter
{
if (value is HatchStyle style)
{
return _brushGenerator.GetHatchBrush(style, ResourceHelper.GetResource<Color>("DarkPrimaryColor"), ResourceHelper.GetResource<Color>("BackgroundColor"));
return _brushGenerator.GetHatchBrush(style, ResourceHelper.GetResource<Color>(ResourceToken.DarkPrimaryColor), ResourceHelper.GetResource<Color>(ResourceToken.BackgroundColor));
}
return Brushes.Transparent;
}

View File

@ -10,7 +10,7 @@ namespace HandyControlDemo.Tools.Converter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
return value is string str ? ResourceHelper.GetResource<Brush>(str) : default(Brush);
return value is string str ? ResourceHelper.GetResource<Brush>(str) : default;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)

View File

@ -26,17 +26,17 @@
</DataGrid.RowHeaderTemplate>
<DataGrid.Columns>
<DataGridTextColumn IsReadOnly="True" Width="80" CanUserResize="False" Binding="{Binding Index}" Header="{x:Static langs:Lang.Index}"/>
<DataGridTemplateColumn Width="50" CanUserResize="False">
<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}"/>
<DataGridTextColumn 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}"/>
<DataGridTextColumn Binding="{Binding Remark}" Header="{x:Static langs:Lang.Remark}"/>
</DataGrid.Columns>
</DataGrid>
</Grid>

View File

@ -0,0 +1,61 @@
<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:hc="https://handyorg.github.io/handycontrol"
Background="{DynamicResource RegionBrush}">
<hc:TransitioningContentControl>
<hc:RelativePanel Width="620" Height="700" Margin="32">
<Border Name="Rect1" Background="{DynamicResource DangerBrush}" Height="50" Width="50">
<TextBlock Text="Rect1" Foreground="White" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Border Name="Rect2" Background="{DynamicResource PrimaryBrush}" Height="50" Width="50" hc:RelativePanel.AlignHorizontalCenterWithPanel="True">
<TextBlock Text="Rect2" Foreground="White" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Border Name="Rect3" Background="{DynamicResource SuccessBrush}" Height="50" Width="50" hc:RelativePanel.AlignRightWithPanel="True">
<TextBlock Text="Rect3" Foreground="White" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Border Name="Rect4" Background="{DynamicResource DangerBrush}" Height="50" Width="50" hc:RelativePanel.AlignBottomWithPanel="True">
<TextBlock Text="Rect4" Foreground="White" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Border Name="Rect5" Background="{DynamicResource PrimaryBrush}" Height="50" Width="50" hc:RelativePanel.AlignBottomWithPanel="True" hc:RelativePanel.AlignHorizontalCenterWithPanel="True">
<TextBlock Text="Rect5" Foreground="White" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Border Name="Rect6" Background="{DynamicResource SuccessBrush}" Height="50" Width="50" hc:RelativePanel.AlignBottomWithPanel="True" hc:RelativePanel.AlignRightWithPanel="True">
<TextBlock Text="Rect6" Foreground="White" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Border Name="Rect7" Background="{DynamicResource PrimaryBrush}" Height="50" hc:RelativePanel.RightOf="{Binding ElementName=Rect1}">
<TextBlock Text="Rect7 (RightOf Rect1)" Padding="10,0" Foreground="White" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Border Name="Rect8" Background="{DynamicResource SuccessBrush}" Height="50" hc:RelativePanel.Below="{Binding ElementName=Rect7}">
<TextBlock Text="Rect8 (Below Rect7)" Padding="10,0" Foreground="White" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Border Name="Rect9" Background="{DynamicResource PrimaryBrush}" Height="140" Width="460" hc:RelativePanel.AlignHorizontalCenterWithPanel="True" hc:RelativePanel.AlignVerticalCenterWithPanel="True">
<TextBlock Text="Rect9" Padding="10" Foreground="White" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Top"/>
</Border>
<Border Name="Rect10" Background="{DynamicResource DangerBrush}" Width="50" hc:RelativePanel.RightOf="{Binding ElementName=Rect9}" hc:RelativePanel.AlignVerticalCenterWith="{Binding ElementName=Rect9}">
<TextBlock Text="Rect14 (RightOf Rect9, AlignVerticalCenterWith Rect9)" Padding="10,0" Foreground="White" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center">
<TextBlock.LayoutTransform>
<TransformGroup>
<RotateTransform Angle="-90"/>
</TransformGroup>
</TextBlock.LayoutTransform>
</TextBlock>
</Border>
<Border Name="Rect11" Background="{DynamicResource DangerBrush}" Height="50" hc:RelativePanel.AlignBottomWith="{Binding ElementName=Rect9}" hc:RelativePanel.AlignHorizontalCenterWith="{Binding ElementName=Rect9}">
<TextBlock Text="Rect11 (AlignBottomWith Rect9, AlignHorizontalCenterWith Rect9)" Padding="10,0" Foreground="White" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Border Name="Rect12" Background="{DynamicResource DangerBrush}" Height="50" hc:RelativePanel.Below="{Binding ElementName=Rect8}" hc:RelativePanel.AlignLeftWith="{Binding ElementName=Rect7}">
<TextBlock Text="Rect12 (Below Rect8, AlignLeftWith Rect7)" Padding="10,0" Foreground="White" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Border Name="Rect13" Background="{DynamicResource PrimaryBrush}" Height="50" hc:RelativePanel.Below="{Binding ElementName=Rect12}" hc:RelativePanel.AlignRightWith="{Binding ElementName=Rect12}">
<TextBlock Text="Rect13 (Below Rect12, AlignRightWith Rect12)" Padding="10,0" Foreground="White" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Border Name="Rect14" Background="{DynamicResource SuccessBrush}" Height="50" hc:RelativePanel.Above="{Binding ElementName=Rect9}" hc:RelativePanel.AlignRightWith="{Binding ElementName=Rect9}">
<TextBlock Text="Rect14 (Above Rect9, AlignRightWith Rect9)" Padding="10,0" Foreground="White" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
<Border Name="Rect15" Background="{DynamicResource DangerBrush}" Height="50" hc:RelativePanel.LeftOf="{Binding ElementName=Rect2}" hc:RelativePanel.AlignTopWith="{Binding ElementName=Rect9}">
<TextBlock Text="Rect15 (LeftOf Rect2, AlignTopWith Rect9)" Padding="10,0" Foreground="White" FontWeight="Bold" HorizontalAlignment="Center" VerticalAlignment="Center"/>
</Border>
</hc:RelativePanel>
</hc:TransitioningContentControl>
</UserControl>

View File

@ -0,0 +1,10 @@
namespace HandyControlDemo.UserControl
{
public partial class RelativePanelDemoCtl
{
public RelativePanelDemoCtl()
{
InitializeComponent();
}
}
}

View File

@ -23,6 +23,11 @@
<Path Data="{StaticResource NugetGeometry}" Fill="#30a5dd"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://marketplace.visualstudio.com/items?itemName=HandyOrg.handycontrolforvs2019" Header="{x:Static langs:Lang.Vsix}">
<MenuItem.Icon>
<Path Data="{StaticResource VisualStudioGeometry}" Fill="{DynamicResource PrimaryTextBrush}"/>
</MenuItem.Icon>
</MenuItem>
</MenuItem>
<MenuItem Height="29" Header="{x:Static langs:Lang.About}">
<MenuItem Command="{Binding OpenViewCmd}" CommandParameter="{x:Static data:MessageToken.ContributorsView}" Header="{x:Static langs:Lang.Contributors}">
@ -50,6 +55,36 @@
<Path Data="{StaticResource CnblogsGeometry}" Fill="{DynamicResource PrimaryTextBrush}"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="{x:Static langs:Lang.Demo}">
<MenuItem.Icon>
<Path Data="{StaticResource CodeGeometry}" Fill="{DynamicResource PrimaryTextBrush}"/>
</MenuItem.Icon>
<MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://github.com/AFei19911012/HandyControl" Header="AFei19911012 / HandyControl">
<MenuItem.Icon>
<Path Data="{StaticResource CodeGeometry}" Fill="{DynamicResource PrimaryTextBrush}"/>
</MenuItem.Icon>
</MenuItem>
</MenuItem>
<MenuItem Header="{x:Static langs:Lang.Documentation}">
<MenuItem.Icon>
<Path Data="{StaticResource DocGeometry}" Fill="{DynamicResource PrimaryBrush}"/>
</MenuItem.Icon>
<MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://github.com/ghost1372/HandyControl/wiki/Documentation" Header="Wiki">
<MenuItem.Icon>
<Path Data="{StaticResource WikiGeometry}" Fill="{DynamicResource PrimaryTextBrush}"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://ghost1372.github.io" Header="{x:Static langs:Lang.Doc_en}">
<MenuItem.Icon>
<Path Data="{StaticResource LogoGeometry}" Fill="#ef6c00"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Command="hc:ControlCommands.OpenLink" CommandParameter="https://handyorg.github.io" Header="{x:Static langs:Lang.Doc_cn}">
<MenuItem.Icon>
<Path Data="{StaticResource LogoGeometry}" Fill="#ef6c00"/>
</MenuItem.Icon>
</MenuItem>
</MenuItem>
<MenuItem Header="{x:Static langs:Lang.About}" Click="MenuAbout_OnClick">
<MenuItem.Icon>
<Path Data="{StaticResource InfoGeometry}" Fill="{DynamicResource SuccessBrush}"/>
@ -67,6 +102,11 @@
<Path Data="{StaticResource BlogGeometry}" Fill="{DynamicResource PrimaryBrush}"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="{x:Static langs:Lang.Website}" Command="{Binding OpenViewCmd}" CommandParameter="{x:Static data:MessageToken.WebsitesView}" >
<MenuItem.Icon>
<Path Data="{StaticResource WebsiteGeometry}" Fill="{DynamicResource WarningBrush}"/>
</MenuItem.Icon>
</MenuItem>
</MenuItem>
</Menu>
</StackPanel>

View File

@ -0,0 +1,14 @@
<UserControl x:Class="HandyControlDemo.UserControl.WebsitesView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:userControl="clr-namespace:HandyControlDemo.UserControl"
DataContext="{Binding WebsitesView,Source={StaticResource Locator}}"
Background="{DynamicResource SecondaryRegionBrush}">
<ListBox Background="{DynamicResource WebsiteDrawingBrush}" ItemContainerStyle="{StaticResource ListBoxItemCustom}" BorderThickness="0" ItemsSource="{Binding DataList}" ItemsPanel="{StaticResource FluidMoveBehaviorWrapPanelItemsPanelTemplate}">
<ListBox.ItemTemplate>
<DataTemplate>
<userControl:Avatar DisplayName="{Binding DisplayName}" Link="{Binding Link}" Source="{Binding AvatarUri}"/>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</UserControl>

View File

@ -0,0 +1,10 @@
namespace HandyControlDemo.UserControl
{
public partial class WebsitesView
{
public WebsitesView()
{
InitializeComponent();
}
}
}

View File

@ -23,10 +23,10 @@
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Width="1*" Binding="{Binding Name}" Header="{x:Static langs:Lang.Name}"/>
<DataGridTextColumn 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}"/>
<DataGridTextColumn Binding="{Binding Remark}" Header="{x:Static langs:Lang.Remark}"/>
</DataGrid.Columns>
</DataGrid>
</TabItem>
@ -40,10 +40,10 @@
</DataTemplate>
</DataGridTemplateColumn.CellTemplate>
</DataGridTemplateColumn>
<DataGridTextColumn Width="1*" Binding="{Binding Name}" Header="{x:Static langs:Lang.Name}"/>
<DataGridTextColumn 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}"/>
<DataGridTextColumn Binding="{Binding Remark}" Header="{x:Static langs:Lang.Remark}"/>
</DataGrid.Columns>
</DataGrid>
</TabItem>

View File

@ -0,0 +1,26 @@
<UserControl x:Class="HandyControlDemo.UserControl.EffectsDemoCtl"
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>
<UniformGrid Margin="16">
<Image Margin="16" Width="120" Height="120" Source="/HandyControlDemo;component/Resources/Img/Album/10.jpg"/>
<Image Width="120" Height="120" Source="/HandyControlDemo;component/Resources/Img/Album/10.jpg">
<Image.Effect>
<hc:ColorComplementEffect/>
</Image.Effect>
</Image>
<Image Width="120" Height="120" Source="/HandyControlDemo;component/Resources/Img/Album/10.jpg">
<Image.Effect>
<hc:GrayScaleEffect/>
</Image.Effect>
</Image>
<Image Width="120" Height="120" Source="/HandyControlDemo;component/Resources/Img/Album/10.jpg">
<Image.Effect>
<hc:GrayScaleEffect Scale=".7"/>
</Image.Effect>
</Image>
</UniformGrid>
</hc:TransitioningContentControl>
</UserControl>

View File

@ -0,0 +1,10 @@
namespace HandyControlDemo.UserControl
{
public partial class EffectsDemoCtl
{
public EffectsDemoCtl()
{
InitializeComponent();
}
}
}

View File

@ -134,8 +134,9 @@ namespace HandyControlDemo.ViewModel
}
var cachePath = $"{AudioCachePath}\\{Guid.NewGuid().ToString()}";
var cachePathWithQuotes = $"\"{cachePath}\"";
ExternDllHelper.MciSendString("stop movie", "", 0, 0);
ExternDllHelper.MciSendString($"save movie {cachePath}", "", 0, 0);
ExternDllHelper.MciSendString($"save movie {cachePathWithQuotes}", "", 0, 0);
ExternDllHelper.MciSendString("close movie", "", 0, 0);
_stopwatch.Stop();

View File

@ -25,6 +25,7 @@ namespace HandyControlDemo.ViewModel
SimpleIoc.Default.Register(() => new ItemsDisplayViewModel(dataService.GetContributorDataList), "Contributors");
SimpleIoc.Default.Register(() => new ItemsDisplayViewModel(dataService.GetBlogDataList), "Blogs");
SimpleIoc.Default.Register(() => new ItemsDisplayViewModel(dataService.GetProjectDataList), "Projects");
SimpleIoc.Default.Register(() => new ItemsDisplayViewModel(dataService.GetWebsiteDataList), "Websites");
SimpleIoc.Default.Register<StepBarDemoViewModel>();
SimpleIoc.Default.Register<PaginationDemoViewModel>();
SimpleIoc.Default.Register<ChatBoxViewModel>();
@ -66,6 +67,8 @@ namespace HandyControlDemo.ViewModel
public ItemsDisplayViewModel ProjectsView => ServiceLocator.Current.GetInstance<ItemsDisplayViewModel>("Projects");
public ItemsDisplayViewModel WebsitesView => ServiceLocator.Current.GetInstance<ItemsDisplayViewModel>("Websites");
public StepBarDemoViewModel StepBarDemo => ServiceLocator.Current.GetInstance<StepBarDemoViewModel>();
public PaginationDemoViewModel PaginationDemo => ServiceLocator.Current.GetInstance<PaginationDemoViewModel>();

View File

@ -434,6 +434,7 @@ namespace HandyControl.Controls
/// </summary>
private void Init()
{
if (_panelColor == null) return;
UpdateStatus(SelectedBrush.Color);
_panelColor.Children.Clear();
foreach (var item in _colorPresetList)

View File

@ -800,7 +800,7 @@ namespace HandyControl.Controls
_timerClose?.Stop();
var transform = new TranslateTransform();
_gridMain.RenderTransform = transform;
var animation = AnimationHelper.CreateAnimation(MaxWidth);
var animation = AnimationHelper.CreateAnimation(ActualWidth);
animation.Completed += (s, e) =>
{
if (Parent is Panel panel)

View File

@ -3,27 +3,30 @@ using System.Windows.Controls;
namespace HandyControl.Controls
{
[TemplatePart(Name = ElementGrowPanel, Type = typeof(Panel))]
internal class GrowlWindow : Window
public sealed class GrowlWindow : Window
{
private const string ElementGrowPanel = "PART_GrowPanel";
internal Panel GrowlPanel { get; set; }
public Panel GrowlPanel { get; set; }
public GrowlWindow()
internal GrowlWindow()
{
WindowStyle = WindowStyle.None;
AllowsTransparency = true;
GrowlPanel = new StackPanel
{
VerticalAlignment = VerticalAlignment.Top,
Margin = new Thickness(0, 10, 10, 10)
};
Content = new ScrollViewer
{
VerticalScrollBarVisibility = ScrollBarVisibility.Hidden,
IsEnableInertia = true,
Content = GrowlPanel
};
}
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
GrowlPanel = GetTemplateChild(ElementGrowPanel) as Panel;
}
public void Init()
internal void Init()
{
var desktopWorkingArea = SystemParameters.WorkArea;
Height = desktopWorkingArea.Height;

View File

@ -39,8 +39,18 @@ namespace HandyControl.Controls
private static void OnUriChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
var ctl = (GifImage) d;
var v = (Uri)e.NewValue;
ctl.Source = new BitmapImage(v);
ctl.StopAnimate();
if (e.NewValue != null)
{
var v = (Uri)e.NewValue;
ctl.GetGifStreamFromPack(v);
ctl.StartAnimate();
}
else
{
ctl.Source = null;
}
}
public Uri Uri

View File

@ -622,6 +622,11 @@ namespace HandyControl.Controls
if (SelectedDateTime != null)
{
if (SelectedDateTime != DisplayDateTime)
{
SetCurrentValue(DisplayDateTimeProperty, SelectedDateTime);
}
var selectedTime = DateTimeToString(SelectedDateTime.Value);
if (string.Compare(selectedTime, s, StringComparison.Ordinal) == 0)

View File

@ -227,7 +227,7 @@ namespace HandyControl.Controls
if (_passwordChar != default(char))
{
ActualPasswordBox.PasswordChar = _passwordChar;
_passwordChar = default(char);
_passwordChar = default;
}
}

View File

@ -78,5 +78,14 @@ namespace HandyControl.Controls
get => (Thickness)GetValue(BadgeMarginProperty);
set => SetValue(BadgeMarginProperty, value);
}
public static readonly DependencyProperty ShowBadgeProperty = DependencyProperty.Register(
"ShowBadge", typeof(bool), typeof(Badge), new PropertyMetadata(ValueBoxes.TrueBox));
public bool ShowBadge
{
get => (bool) GetValue(ShowBadgeProperty);
set => SetValue(ShowBadgeProperty, value);
}
}
}

View File

@ -636,6 +636,22 @@ namespace HandyControl.Controls
}
else if (ContextMenu != null)
{
if (ContextMenu.Items.Count == 0) return;
ContextMenu.InvalidateProperty(StyleProperty);
foreach (var item in ContextMenu.Items)
{
if (item is MenuItem menuItem)
{
menuItem.InvalidateProperty(StyleProperty);
}
else
{
var container = ContextMenu.ItemContainerGenerator.ContainerFromItem(item) as MenuItem;
container?.InvalidateProperty(StyleProperty);
}
}
ContextMenu.Placement = PlacementMode.Mouse;
ContextMenu.IsOpen = true;

View File

@ -0,0 +1,501 @@
//reference doc : https://docs.microsoft.com/en-us/uwp/api/Windows.UI.Xaml.Controls.RelativePanel
using System;
using System.Collections.Generic;
using System.Linq;
using System.Windows;
using System.Windows.Controls;
using HandyControl.Data;
namespace HandyControl.Controls
{
public class RelativePanel : Panel
{
private readonly Graph _childGraph;
public RelativePanel() => _childGraph = new Graph();
#region
public static readonly DependencyProperty AlignLeftWithPanelProperty = DependencyProperty.RegisterAttached(
"AlignLeftWithPanel", typeof(bool), typeof(RelativePanel), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.AffectsRender));
public static void SetAlignLeftWithPanel(DependencyObject element, bool value)
=> element.SetValue(AlignLeftWithPanelProperty, value);
public static bool GetAlignLeftWithPanel(DependencyObject element)
=> (bool) element.GetValue(AlignLeftWithPanelProperty);
public static readonly DependencyProperty AlignTopWithPanelProperty = DependencyProperty.RegisterAttached(
"AlignTopWithPanel", typeof(bool), typeof(RelativePanel), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.AffectsRender));
public static void SetAlignTopWithPanel(DependencyObject element, bool value)
=> element.SetValue(AlignTopWithPanelProperty, value);
public static bool GetAlignTopWithPanel(DependencyObject element)
=> (bool) element.GetValue(AlignTopWithPanelProperty);
public static readonly DependencyProperty AlignRightWithPanelProperty = DependencyProperty.RegisterAttached(
"AlignRightWithPanel", typeof(bool), typeof(RelativePanel), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.AffectsRender));
public static void SetAlignRightWithPanel(DependencyObject element, bool value)
=> element.SetValue(AlignRightWithPanelProperty, value);
public static bool GetAlignRightWithPanel(DependencyObject element)
=> (bool) element.GetValue(AlignRightWithPanelProperty);
public static readonly DependencyProperty AlignBottomWithPanelProperty = DependencyProperty.RegisterAttached(
"AlignBottomWithPanel", typeof(bool), typeof(RelativePanel), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.AffectsRender));
public static void SetAlignBottomWithPanel(DependencyObject element, bool value)
=> element.SetValue(AlignBottomWithPanelProperty, value);
public static bool GetAlignBottomWithPanel(DependencyObject element)
=> (bool) element.GetValue(AlignBottomWithPanelProperty);
#endregion
#region
public static readonly DependencyProperty AlignLeftWithProperty = DependencyProperty.RegisterAttached(
"AlignLeftWith", typeof(UIElement), typeof(RelativePanel), new FrameworkPropertyMetadata(default(UIElement), FrameworkPropertyMetadataOptions.AffectsRender));
public static void SetAlignLeftWith(DependencyObject element, UIElement value)
=> element.SetValue(AlignLeftWithProperty, value);
public static UIElement GetAlignLeftWith(DependencyObject element)
=> (UIElement) element.GetValue(AlignLeftWithProperty);
public static readonly DependencyProperty AlignTopWithProperty = DependencyProperty.RegisterAttached(
"AlignTopWith", typeof(UIElement), typeof(RelativePanel), new FrameworkPropertyMetadata(default(UIElement), FrameworkPropertyMetadataOptions.AffectsRender));
public static void SetAlignTopWith(DependencyObject element, UIElement value)
=> element.SetValue(AlignTopWithProperty, value);
public static UIElement GetAlignTopWith(DependencyObject element)
=> (UIElement) element.GetValue(AlignTopWithProperty);
public static readonly DependencyProperty AlignRightWithProperty = DependencyProperty.RegisterAttached(
"AlignRightWith", typeof(UIElement), typeof(RelativePanel), new FrameworkPropertyMetadata(default(UIElement), FrameworkPropertyMetadataOptions.AffectsRender));
public static void SetAlignRightWith(DependencyObject element, UIElement value)
=> element.SetValue(AlignRightWithProperty, value);
public static UIElement GetAlignRightWith(DependencyObject element)
=> (UIElement) element.GetValue(AlignRightWithProperty);
public static readonly DependencyProperty AlignBottomWithProperty = DependencyProperty.RegisterAttached(
"AlignBottomWith", typeof(UIElement), typeof(RelativePanel), new FrameworkPropertyMetadata(default(UIElement), FrameworkPropertyMetadataOptions.AffectsRender));
public static void SetAlignBottomWith(DependencyObject element, UIElement value)
=> element.SetValue(AlignBottomWithProperty, value);
public static UIElement GetAlignBottomWith(DependencyObject element)
=> (UIElement) element.GetValue(AlignBottomWithProperty);
#endregion
#region
public static readonly DependencyProperty LeftOfProperty = DependencyProperty.RegisterAttached(
"LeftOf", typeof(UIElement), typeof(RelativePanel), new FrameworkPropertyMetadata(default(UIElement), FrameworkPropertyMetadataOptions.AffectsRender));
public static void SetLeftOf(DependencyObject element, UIElement value)
=> element.SetValue(LeftOfProperty, value);
public static UIElement GetLeftOf(DependencyObject element)
=> (UIElement)element.GetValue(LeftOfProperty);
public static readonly DependencyProperty AboveProperty = DependencyProperty.RegisterAttached(
"Above", typeof(UIElement), typeof(RelativePanel), new FrameworkPropertyMetadata(default(UIElement), FrameworkPropertyMetadataOptions.AffectsRender));
public static void SetAbove(DependencyObject element, UIElement value)
=> element.SetValue(AboveProperty, value);
public static UIElement GetAbove(DependencyObject element)
=> (UIElement)element.GetValue(AboveProperty);
public static readonly DependencyProperty RightOfProperty = DependencyProperty.RegisterAttached(
"RightOf", typeof(UIElement), typeof(RelativePanel), new FrameworkPropertyMetadata(default(UIElement), FrameworkPropertyMetadataOptions.AffectsRender));
public static void SetRightOf(DependencyObject element, UIElement value)
=> element.SetValue(RightOfProperty, value);
public static UIElement GetRightOf(DependencyObject element)
=> (UIElement)element.GetValue(RightOfProperty);
public static readonly DependencyProperty BelowProperty = DependencyProperty.RegisterAttached(
"Below", typeof(UIElement), typeof(RelativePanel), new FrameworkPropertyMetadata(default(UIElement), FrameworkPropertyMetadataOptions.AffectsRender));
public static void SetBelow(DependencyObject element, UIElement value)
=> element.SetValue(BelowProperty, value);
public static UIElement GetBelow(DependencyObject element)
=> (UIElement) element.GetValue(BelowProperty);
#endregion
#region
public static readonly DependencyProperty AlignHorizontalCenterWithPanelProperty = DependencyProperty.RegisterAttached(
"AlignHorizontalCenterWithPanel", typeof(bool), typeof(RelativePanel), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.AffectsRender));
public static void SetAlignHorizontalCenterWithPanel(DependencyObject element, bool value)
=> element.SetValue(AlignHorizontalCenterWithPanelProperty, value);
public static bool GetAlignHorizontalCenterWithPanel(DependencyObject element)
=> (bool)element.GetValue(AlignHorizontalCenterWithPanelProperty);
public static readonly DependencyProperty AlignVerticalCenterWithPanelProperty = DependencyProperty.RegisterAttached(
"AlignVerticalCenterWithPanel", typeof(bool), typeof(RelativePanel), new FrameworkPropertyMetadata(ValueBoxes.FalseBox, FrameworkPropertyMetadataOptions.AffectsRender));
public static void SetAlignVerticalCenterWithPanel(DependencyObject element, bool value)
=> element.SetValue(AlignVerticalCenterWithPanelProperty, value);
public static bool GetAlignVerticalCenterWithPanel(DependencyObject element)
=> (bool)element.GetValue(AlignVerticalCenterWithPanelProperty);
public static readonly DependencyProperty AlignHorizontalCenterWithProperty = DependencyProperty.RegisterAttached(
"AlignHorizontalCenterWith", typeof(UIElement), typeof(RelativePanel), new FrameworkPropertyMetadata(default(UIElement), FrameworkPropertyMetadataOptions.AffectsRender));
public static void SetAlignHorizontalCenterWith(DependencyObject element, UIElement value)
=> element.SetValue(AlignHorizontalCenterWithProperty, value);
public static UIElement GetAlignHorizontalCenterWith(DependencyObject element)
=> (UIElement)element.GetValue(AlignHorizontalCenterWithProperty);
public static readonly DependencyProperty AlignVerticalCenterWithProperty = DependencyProperty.RegisterAttached(
"AlignVerticalCenterWith", typeof(UIElement), typeof(RelativePanel), new FrameworkPropertyMetadata(default(UIElement), FrameworkPropertyMetadataOptions.AffectsRender));
public static void SetAlignVerticalCenterWith(DependencyObject element, UIElement value)
=> element.SetValue(AlignVerticalCenterWithProperty, value);
public static UIElement GetAlignVerticalCenterWith(DependencyObject element)
=> (UIElement)element.GetValue(AlignVerticalCenterWithProperty);
#endregion
protected override Size MeasureOverride(Size availableSize)
{
foreach (UIElement child in InternalChildren)
{
child?.Measure(availableSize);
}
return base.MeasureOverride(availableSize);
}
protected override Size ArrangeOverride(Size arrangeSize)
{
_childGraph.Reset(arrangeSize);
foreach (UIElement child in InternalChildren)
{
if (child == null) continue;
var node = _childGraph.AddNode(child);
node.AlignLeftWithNode = _childGraph.AddLink(node, GetAlignLeftWith(child));
node.AlignTopWithNode = _childGraph.AddLink(node, GetAlignTopWith(child));
node.AlignRightWithNode = _childGraph.AddLink(node, GetAlignRightWith(child));
node.AlignBottomWithNode = _childGraph.AddLink(node, GetAlignBottomWith(child));
node.LeftOfNode = _childGraph.AddLink(node, GetLeftOf(child));
node.AboveNode = _childGraph.AddLink(node, GetAbove(child));
node.RightOfNode = _childGraph.AddLink(node, GetRightOf(child));
node.BelowNode = _childGraph.AddLink(node, GetBelow(child));
node.AlignHorizontalCenterWith = _childGraph.AddLink(node, GetAlignHorizontalCenterWith(child));
node.AlignVerticalCenterWith = _childGraph.AddLink(node, GetAlignVerticalCenterWith(child));
}
if (_childGraph.CheckCyclic())
{
throw new Exception("RelativePanel error: Circular dependency detected. Layout could not complete.");
}
return arrangeSize;
}
private class GraphNode
{
public Point Position { get; set; }
public bool Arranged { get; set; }
public UIElement Element { get; }
public HashSet<GraphNode> OutgoingNodes { get; }
public GraphNode AlignLeftWithNode { get; set; }
public GraphNode AlignTopWithNode { get; set; }
public GraphNode AlignRightWithNode { get; set; }
public GraphNode AlignBottomWithNode { get; set; }
public GraphNode LeftOfNode { get; set; }
public GraphNode AboveNode { get; set; }
public GraphNode RightOfNode { get; set; }
public GraphNode BelowNode { get; set; }
public GraphNode AlignHorizontalCenterWith { get; set; }
public GraphNode AlignVerticalCenterWith { get; set; }
public GraphNode(UIElement element)
{
OutgoingNodes = new HashSet<GraphNode>();
Element = element;
}
}
private class Graph
{
private readonly Dictionary<DependencyObject, GraphNode> _nodeDic;
private Size _arrangeSize;
public Graph()
{
_nodeDic = new Dictionary<DependencyObject, GraphNode>();
}
public GraphNode AddLink(GraphNode from, UIElement to)
{
if (to == null) return null;
GraphNode nodeTo;
if (_nodeDic.ContainsKey(to))
{
nodeTo = _nodeDic[to];
}
else
{
nodeTo = new GraphNode(to);
_nodeDic[to] = nodeTo;
}
from.OutgoingNodes.Add(nodeTo);
return nodeTo;
}
public GraphNode AddNode(UIElement value)
{
if (!_nodeDic.ContainsKey(value))
{
var node = new GraphNode(value);
_nodeDic.Add(value, node);
return node;
}
return _nodeDic[value];
}
public void Reset(Size arrangeSize)
{
_arrangeSize = arrangeSize;
_nodeDic.Clear();
}
public bool CheckCyclic() => CheckCyclic(_nodeDic.Values, null);
private bool CheckCyclic(IEnumerable<GraphNode> nodes, HashSet<DependencyObject> set)
{
if (set == null)
{
set = new HashSet<DependencyObject>();
}
foreach (var node in nodes)
{
/*
*
*
*/
if (!node.Arranged && node.OutgoingNodes.Count == 0)
{
ArrangeChild(node, true);
continue;
}
// 判断依赖元素是否全部排列完毕
if (node.OutgoingNodes.All(item => item.Arranged))
{
ArrangeChild(node);
continue;
}
// 判断是否有循环
if (!set.Add(node.Element)) return true;
// 没有循环,且有依赖,则继续往下
return CheckCyclic(node.OutgoingNodes, set);
}
return false;
}
private void ArrangeChild(GraphNode node, bool ignoneSibling = false)
{
var child = node.Element;
var childSize = child.DesiredSize;
var childPos = new Point();
#region
if (GetAlignHorizontalCenterWithPanel(child))
{
childPos.X = (_arrangeSize.Width - childSize.Width) / 2;
}
if (GetAlignVerticalCenterWithPanel(child))
{
childPos.Y = (_arrangeSize.Height - childSize.Height) / 2;
}
#endregion
var alignLeftWithPanel = GetAlignLeftWithPanel(child);
var alignTopWithPanel = GetAlignTopWithPanel(child);
var alignRightWithPanel = GetAlignRightWithPanel(child);
var alignBottomWithPanel = GetAlignBottomWithPanel(child);
if (!ignoneSibling)
{
#region
if (node.LeftOfNode != null)
{
childPos.X = node.LeftOfNode.Position.X - childSize.Width;
}
if (node.AboveNode != null)
{
childPos.Y = node.AboveNode.Position.Y - childSize.Height;
}
if (node.RightOfNode != null)
{
childPos.X = node.RightOfNode.Position.X + node.RightOfNode.Element.DesiredSize.Width;
}
if (node.BelowNode != null)
{
childPos.Y = node.BelowNode.Position.Y + node.BelowNode.Element.DesiredSize.Height;
}
#endregion
#region
if (node.AlignHorizontalCenterWith != null)
{
childPos.X = node.AlignHorizontalCenterWith.Position.X +
(node.AlignHorizontalCenterWith.Element.DesiredSize.Width - childSize.Width) / 2;
}
if (node.AlignVerticalCenterWith != null)
{
childPos.Y = node.AlignVerticalCenterWith.Position.Y +
(node.AlignVerticalCenterWith.Element.DesiredSize.Height - childSize.Height) / 2;
}
#endregion
#region
if (node.AlignLeftWithNode != null)
{
childPos.X = node.AlignLeftWithNode.Position.X;
}
if (node.AlignTopWithNode != null)
{
childPos.Y = node.AlignTopWithNode.Position.Y;
}
if (node.AlignRightWithNode != null)
{
childPos.X = node.AlignRightWithNode.Element.DesiredSize.Width + node.AlignRightWithNode.Position.X - childSize.Width;
}
if (node.AlignBottomWithNode != null)
{
childPos.Y = node.AlignBottomWithNode.Element.DesiredSize.Height + node.AlignBottomWithNode.Position.Y - childSize.Height;
}
#endregion
}
#region
if (alignLeftWithPanel)
{
if (node.AlignRightWithNode != null)
{
childPos.X = (node.AlignRightWithNode.Element.DesiredSize.Width + node.AlignRightWithNode.Position.X - childSize.Width) / 2;
}
else
{
childPos.X = 0;
}
}
if (alignTopWithPanel)
{
if (node.AlignBottomWithNode != null)
{
childPos.Y = (node.AlignBottomWithNode.Element.DesiredSize.Height + node.AlignBottomWithNode.Position.Y - childSize.Height) / 2;
}
else
{
childPos.Y = 0;
}
}
if (alignRightWithPanel)
{
if (alignLeftWithPanel)
{
childPos.X = (_arrangeSize.Width - childSize.Width) / 2;
}
else if(node.AlignLeftWithNode == null)
{
childPos.X = _arrangeSize.Width - childSize.Width;
}
else
{
childPos.X = (_arrangeSize.Width + node.AlignLeftWithNode.Position.X - childSize.Width) / 2;
}
}
if (alignBottomWithPanel)
{
if (alignTopWithPanel)
{
childPos.Y = (_arrangeSize.Height - childSize.Height) / 2;
}
else if (node.AlignTopWithNode == null)
{
childPos.Y = _arrangeSize.Height - childSize.Height;
}
else
{
childPos.Y = (_arrangeSize.Height + node.AlignLeftWithNode.Position.Y - childSize.Height) / 2;
}
}
#endregion
child.Arrange(new Rect(childPos.X, childPos.Y, childSize.Width, childSize.Height));
node.Position = childPos;
node.Arranged = true;
}
}
}
}

View File

@ -40,6 +40,8 @@ namespace HandyControl.Controls
{
if (item.Role == SideMenuItemRole.Item)
{
_isItemSelected = true;
if (Equals(item, _selectedItem)) return;
if (_selectedItem != null)
@ -53,7 +55,6 @@ namespace HandyControl.Controls
{
Info = e.OriginalSource
});
_isItemSelected = true;
}
else
{
@ -92,7 +93,10 @@ namespace HandyControl.Controls
}
else if(_selectedHeader != null)
{
_selectedHeader.SelectDefaultItem();
if (AutoSelect)
{
_selectedHeader.SelectDefaultItem();
}
_isItemSelected = false;
}
}
@ -117,6 +121,15 @@ namespace HandyControl.Controls
protected override bool IsItemItsOwnContainerOverride(object item) => item is SideMenuItem;
public static readonly DependencyProperty AutoSelectProperty = DependencyProperty.Register(
"AutoSelect", typeof(bool), typeof(SideMenu), new PropertyMetadata(ValueBoxes.TrueBox));
public bool AutoSelect
{
get => (bool) GetValue(AutoSelectProperty);
set => SetValue(AutoSelectProperty, value);
}
public static readonly DependencyProperty ExpandModeProperty = DependencyProperty.Register(
"ExpandMode", typeof(ExpandMode), typeof(SideMenu), new PropertyMetadata(default(ExpandMode), OnExpandModeChanged));

View File

@ -102,7 +102,15 @@ namespace HandyControl.Controls
/// </summary>
internal TabPanel TabPanel
{
get => _tabPanel ??= TabControlParent.HeaderPanel;
get
{
if (_tabPanel == null && TabControlParent != null)
{
_tabPanel = TabControlParent.HeaderPanel;
}
return _tabPanel;
}
set => _tabPanel = value;
}
@ -200,7 +208,7 @@ namespace HandyControl.Controls
menu.SetBinding(VisibilityProperty, new Binding(ShowContextMenuProperty.Name)
{
Source = this,
Converter = ResourceHelper.GetResource<IValueConverter>("Boolean2VisibilityConverter")
Converter = ResourceHelper.GetResource<IValueConverter>(ResourceToken.Boolean2VisibilityConverter)
});
}
}
@ -304,7 +312,7 @@ namespace HandyControl.Controls
ItemIsDragging = true;
_isWaiting = true;
_dragPoint = e.GetPosition(parent);
_dragPoint = new Point(_dragPoint.X + +_scrollHorizontalOffset, _dragPoint.Y);
_dragPoint = new Point(_dragPoint.X + _scrollHorizontalOffset, _dragPoint.Y);
_mouseDownPoint = _dragPoint;
CaptureMouse();
}
@ -432,6 +440,11 @@ namespace HandyControl.Controls
/// <returns></returns>
private int CalLocationIndex(double left)
{
if (_isWaiting)
{
return CurrentIndex;
}
var maxIndex = TabControlParent.Items.Count - 1;
var div = (int)(left / ItemWidth);
var rest = left % ItemWidth;

View File

@ -67,7 +67,7 @@ namespace HandyControl.Data
/// <returns></returns>
public Color GetColor(double range)
{
if (range < 0 || range > 1) return default(Color);
if (range < 0 || range > 1) return default;
return Color.FromArgb((byte)(_color1.A - _subColorArr[0] * range), (byte)(_color1.R - _subColorArr[1] * range),
(byte)(_color1.G - _subColorArr[2] * range), (byte)(_color1.B - _subColorArr[3] * range));
}

View File

@ -2,6 +2,76 @@
{
public class ResourceToken
{
#region Basic
#region Geometry
public const string CalendarGeometry = nameof(CalendarGeometry);
public const string DeleteGeometry = nameof(DeleteGeometry);
public const string DeleteFillCircleGeometry = nameof(DeleteFillCircleGeometry);
public const string CloseGeometry = nameof(CloseGeometry);
public const string UpGeometry = nameof(UpGeometry);
public const string DownGeometry = nameof(DownGeometry);
public const string ClockGeometry = nameof(ClockGeometry);
public const string LeftGeometry = nameof(LeftGeometry);
public const string RightGeometry = nameof(RightGeometry);
public const string RotateLeftGeometry = nameof(RotateLeftGeometry);
public const string EnlargeGeometry = nameof(EnlargeGeometry);
public const string ReduceGeometry = nameof(ReduceGeometry);
public const string DownloadGeometry = nameof(DownloadGeometry);
public const string SaveGeometry = nameof(SaveGeometry);
public const string WindowsGeometry = nameof(WindowsGeometry);
public const string FullScreenGeometry = nameof(FullScreenGeometry);
public const string FullScreenReturnGeometry = nameof(FullScreenReturnGeometry);
public const string SearchGeometry = nameof(SearchGeometry);
public const string UpDownGeometry = nameof(UpDownGeometry);
public const string WindowMinGeometry = nameof(WindowMinGeometry);
public const string CheckedGeometry = nameof(CheckedGeometry);
public const string EyeOpenGeometry = nameof(EyeOpenGeometry);
public const string EyeCloseGeometry = nameof(EyeCloseGeometry);
public const string WindowRestoreGeometry = nameof(WindowRestoreGeometry);
public const string WindowMaxGeometry = nameof(WindowMaxGeometry);
public const string AudioGeometry = nameof(AudioGeometry);
public const string BubbleTailGeometry = nameof(BubbleTailGeometry);
public const string StarGeometry = nameof(StarGeometry);
public const string AddGeometry = nameof(AddGeometry);
public const string SubGeometry = nameof(SubGeometry);
public const string AllGeometry = nameof(AllGeometry);
public const string DragGeometry = nameof(DragGeometry);
public const string DropperGeometry = nameof(DropperGeometry);
public const string SuccessGeometry = nameof(SuccessGeometry);
public const string InfoGeometry = nameof(InfoGeometry);
@ -14,22 +84,216 @@
public const string FatalGeometry = nameof(FatalGeometry);
#endregion
#region Brush
public const string PrimaryBrush = nameof(PrimaryBrush);
public const string DarkPrimaryBrush = nameof(DarkPrimaryBrush);
public const string SuccessBrush = nameof(SuccessBrush);
public const string DarkSuccessBrush = nameof(DarkSuccessBrush);
public const string InfoBrush = nameof(InfoBrush);
public const string DarkInfoBrush = nameof(DarkInfoBrush);
public const string DangerBrush = nameof(DangerBrush);
public const string DarkDangerBrush = nameof(DarkDangerBrush);
public const string WarningBrush = nameof(WarningBrush);
public const string DarkWarningBrush = nameof(DarkWarningBrush);
public const string AccentBrush = nameof(AccentBrush);
public const string DarkAccentBrush = nameof(DarkAccentBrush);
public const string PrimaryTextBrush = nameof(PrimaryTextBrush);
public const string SecondaryTextBrush = nameof(SecondaryTextBrush);
public const string ThirdlyTextBrush = nameof(ThirdlyTextBrush);
public const string ReverseTextBrush = nameof(ReverseTextBrush);
public const string TextIconBrush = nameof(TextIconBrush);
public const string BorderBrush = nameof(BorderBrush);
public const string SecondaryBorderBrush = nameof(SecondaryBorderBrush);
public const string BackgroundBrush = nameof(BackgroundBrush);
public const string RegionBrush = nameof(RegionBrush);
public const string SecondaryRegionBrush = nameof(SecondaryRegionBrush);
public const string ThirdlyRegionBrush = nameof(ThirdlyRegionBrush);
public const string TitleBrush = nameof(TitleBrush);
public const string DefaultBrush = nameof(DefaultBrush);
public const string DarkDefaultBrush = nameof(DarkDefaultBrush);
public const string DarkMaskBrush = nameof(DarkMaskBrush);
public const string DarkOpacityBrush = nameof(DarkOpacityBrush);
#endregion
#region Converter
public const string Boolean2BooleanReConverter = nameof(Boolean2BooleanReConverter);
public const string Boolean2VisibilityReConverter = nameof(Boolean2VisibilityReConverter);
public const string BooleanArr2VisibilityConverter = nameof(BooleanArr2VisibilityConverter);
public const string Long2FileSizeConverter = nameof(Long2FileSizeConverter);
public const string String2VisibilityConverter = nameof(String2VisibilityConverter);
public const string String2VisibilityReConverter = nameof(String2VisibilityReConverter);
public const string Boolean2VisibilityConverter = nameof(Boolean2VisibilityConverter);
public const string TreeViewItemMarginConverter = nameof(TreeViewItemMarginConverter);
public const string Color2HexStringConverter = nameof(Color2HexStringConverter);
public const string Object2BooleanConverter = nameof(Object2BooleanConverter);
public const string Boolean2StringConverter = nameof(Boolean2StringConverter);
public const string Int2StringConverter = nameof(Int2StringConverter);
public const string BorderClipConverter = nameof(BorderClipConverter);
public const string BorderCircularClipConverter = nameof(BorderCircularClipConverter);
public const string BorderCircularConverter = nameof(BorderCircularConverter);
public const string Object2VisibilityConverter = nameof(Object2VisibilityConverter);
public const string Number2PercentageConverter = nameof(Number2PercentageConverter);
public const string RectangleCircularConverter = nameof(RectangleCircularConverter);
public const string ThicknessSplitConverter = nameof(ThicknessSplitConverter);
public const string CornerRadiusSplitConverter = nameof(CornerRadiusSplitConverter);
public const string MenuScrollingVisibilityConverter = nameof(MenuScrollingVisibilityConverter);
public const string Double2GridLengthConverter = nameof(Double2GridLengthConverter);
public const string DoubleMinConverter = nameof(DoubleMinConverter);
#endregion
#region Effect
public const string EffectShadowColor = nameof(EffectShadowColor);
public const string EffectShadow1 = nameof(EffectShadow1);
public const string EffectShadow2 = nameof(EffectShadow2);
public const string EffectShadow3 = nameof(EffectShadow3);
public const string EffectShadow4 = nameof(EffectShadow4);
public const string EffectShadow5 = nameof(EffectShadow5);
#endregion
#region Color
public const string PrimaryColor = nameof(PrimaryColor);
public const string DarkPrimaryColor = nameof(DarkPrimaryColor);
public const string DangerColor = nameof(DangerColor);
public const string DarkDangerColor = nameof(DarkDangerColor);
public const string WarningColor = nameof(WarningColor);
public const string DarkWarningColor = nameof(DarkWarningColor);
public const string InfoColor = nameof(InfoColor);
public const string DarkInfoColor = nameof(DarkInfoColor);
public const string SuccessColor = nameof(SuccessColor);
public const string DarkSuccessColor = nameof(DarkSuccessColor);
public const string PrimaryTextColor = nameof(PrimaryTextColor);
public const string SecondaryTextColor = nameof(SecondaryTextColor);
public const string ThirdlyTextColor = nameof(ThirdlyTextColor);
public const string ReverseTextColor = nameof(ReverseTextColor);
public const string TextIconColor = nameof(TextIconColor);
public const string BorderColor = nameof(BorderColor);
public const string SecondaryBorderColor = nameof(SecondaryBorderColor);
public const string BackgroundColor = nameof(BackgroundColor);
public const string RegionColor = nameof(RegionColor);
public const string SecondaryRegionColor = nameof(SecondaryRegionColor);
public const string ThirdlyRegionColor = nameof(ThirdlyRegionColor);
public const string TitleColor = nameof(TitleColor);
public const string SecondaryTitleColor = nameof(SecondaryTitleColor);
public const string DefaultColor = nameof(DefaultColor);
public const string DarkDefaultColor = nameof(DarkDefaultColor);
public const string AccentColor = nameof(AccentColor);
public const string DarkAccentColor = nameof(DarkAccentColor);
public const string DarkMaskColor = nameof(DarkMaskColor);
public const string DarkOpacityColor = nameof(DarkOpacityColor);
#endregion
#region Behavior
public const string BehaviorXY200 = nameof(BehaviorXY200);
public const string BehaviorX200 = nameof(BehaviorX200);
public const string BehaviorY200 = nameof(BehaviorY200);
public const string BehaviorXY400 = nameof(BehaviorXY400);
public const string BehaviorX400 = nameof(BehaviorX400);
public const string BehaviorY400 = nameof(BehaviorY400);
#endregion
#endregion
#region Internal
internal const string BlurGradientValue = nameof(BlurGradientValue);
internal const string ButtonCustom = nameof(ButtonCustom);
@ -87,7 +351,7 @@
internal const string TabItemCapsuleVerticalFirst = nameof(TabItemCapsuleVerticalFirst);
internal const string TabItemCapsuleVerticalLast = nameof(TabItemCapsuleVerticalLast);
internal const string BehaviorXY400 = nameof(BehaviorXY400);
#endregion
}
}

View File

@ -83,7 +83,7 @@ namespace HandyControl.Expression.Drawing
return false;
}
if ((list is List<T> list2) && (factory == null))
if ((list is List<T> list2) && factory == null)
{
list2.AddRange(new T[count - list.Count]);
}
@ -91,7 +91,7 @@ namespace HandyControl.Expression.Drawing
{
for (var i = list.Count; i < count; i++)
{
list.Add((factory == null) ? default(T) : factory());
list.Add(factory == null ? default : factory());
}
}
return true;

View File

@ -35,6 +35,7 @@
<Compile Include="$(MSBuildThisFileDirectory)Controls\Other\Sprite.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Block\ToggleBlock.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Panel\HoneycombPanel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Panel\RelativePanel.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Slider\RangeSlider\RangeTrack.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Slider\RangeSlider\RangeThumb.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Slider\RangeSlider\TwoWayRangeBase.cs" />
@ -57,10 +58,13 @@
<Compile Include="$(MSBuildThisFileDirectory)Media\Animation\LinearGeometryKeyFrame.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Media\Animation\ResolvedKeyFrameEntry.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Media\Animation\SplineGeometryKeyFrame.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Media\Effects\ColorComplementEffect.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Media\Effects\GrayScaleEffect.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\BorderCircularClipConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\ColLayoutConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\CornerRadiusSplitConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\Double2GridLengthConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\DoubleMinConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\Number2PercentageConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\RectangleCircularConverter.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Tools\Converter\ThicknessSplitConverter.cs" />
@ -90,8 +94,8 @@
<Compile Include="$(MSBuildThisFileDirectory)Controls\Cover\CoverView\CoverView.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Cover\CoverView\CoverViewContent.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Cover\CoverView\CoverViewItem.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Grid\Col.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Grid\Row.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Panel\Grid\Col.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Panel\Grid\Row.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Image\GifImage.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Image\ImageViewer.cs" />
<Compile Include="$(MSBuildThisFileDirectory)Controls\Input\ComboBox.cs" />
@ -906,13 +910,7 @@
</Page>
</ItemGroup>
<ItemGroup>
<Folder Include="$(MSBuildThisFileDirectory)Controls\Growl\" />
<Folder Include="$(MSBuildThisFileDirectory)Tools\Generator\" />
</ItemGroup>
<ItemGroup>
<Page Update="E:\Work\GitHub\HandyControl\src\Shared\HandyControl_Shared\Themes\Styles\Base\SplitButtonBaseStyle.xaml">
<SubType>Designer</SubType>
<Generator>MSBuild:Compile</Generator>
</Page>
<None Include="$(MSBuildThisFileDirectory)Resources\Effects\ColorComplementEffect.fx" />
<None Include="$(MSBuildThisFileDirectory)Resources\Effects\GrayScaleEffect.fx" />
</ItemGroup>
</Project>

View File

@ -0,0 +1,35 @@
using System;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Effects;
namespace HandyControl.Media.Effects
{
public class ColorComplementEffect : ShaderEffect
{
public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(ColorComplementEffect), 0);
private static readonly PixelShader Shader;
static ColorComplementEffect()
{
Shader = new PixelShader
{
UriSource = new Uri("pack://application:,,,/HandyControl;component/Resources/Effects/ColorComplementEffect.ps")
};
}
public ColorComplementEffect()
{
PixelShader = Shader;
UpdateShaderValue(InputProperty);
}
public Brush Input
{
get => (Brush)GetValue(InputProperty);
set => SetValue(InputProperty, value);
}
}
}

View File

@ -0,0 +1,46 @@
using System;
using System.Windows;
using System.Windows.Media;
using System.Windows.Media.Effects;
using HandyControl.Data;
namespace HandyControl.Media.Effects
{
public class GrayScaleEffect : ShaderEffect
{
public static readonly DependencyProperty InputProperty = RegisterPixelShaderSamplerProperty("Input", typeof(GrayScaleEffect), 0);
private static readonly PixelShader Shader;
static GrayScaleEffect()
{
Shader = new PixelShader
{
UriSource = new Uri("pack://application:,,,/HandyControl;component/Resources/Effects/GrayScaleEffect.ps")
};
}
public GrayScaleEffect()
{
PixelShader = Shader;
UpdateShaderValue(InputProperty);
UpdateShaderValue(ScaleProperty);
}
public Brush Input
{
get => (Brush)GetValue(InputProperty);
set => SetValue(InputProperty, value);
}
public static readonly DependencyProperty ScaleProperty = DependencyProperty.Register(
"Scale", typeof(double), typeof(GrayScaleEffect), new PropertyMetadata(ValueBoxes.Double1Box, PixelShaderConstantCallback(0)));
public double Scale
{
get => (double) GetValue(ScaleProperty);
set => SetValue(ScaleProperty, value);
}
}
}

View File

@ -12,7 +12,7 @@ using System.Runtime.InteropServices;
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
[assembly: AssemblyVersion("2.3.0")]
[assembly: AssemblyVersion("2.4.0")]
#endif
[assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Controls")]
@ -22,6 +22,7 @@ using System.Runtime.InteropServices;
[assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Expression.Shapes")]
[assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Expression.Media")]
[assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Media.Animation")]
[assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Media.Effects")]
[assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Data")]
[assembly: XmlnsDefinition("https://handyorg.github.io/handycontrol", "HandyControl.Properties.Langs")]
[assembly: XmlnsPrefix("https://handyorg.github.io/handycontrol", "hc")]

View File

@ -0,0 +1,10 @@
float4 main(float2 uv : TEXCOORD) : COLOR
{
float4 color = tex2D(implicitInput, uv);
float4 complement;
complement.rgb = color.a - color.rgb;
complement.a = color.a;
return complement;
}

View File

@ -0,0 +1,15 @@
sampler2D implicitInput : register(s0);
float scale : register(c0);
float4 main(float2 uv : TEXCOORD) : COLOR
{
float4 color = tex2D(implicitInput, uv);
float4 complement;
float intensity = (color.r + color.g + color.b) / 3;
complement.rgb = color.rgb * (1 - scale) + intensity * scale;
complement.a = color.a;
return complement;
}

View File

@ -24,4 +24,5 @@
<converter:CornerRadiusSplitConverter x:Key="CornerRadiusSplitConverter"/>
<MenuScrollingVisibilityConverter x:Key="MenuScrollingVisibilityConverter"/>
<converter:Double2GridLengthConverter x:Key="Double2GridLengthConverter" />
<converter:DoubleMinConverter x:Key="DoubleMinConverter" />
</ResourceDictionary>

View File

@ -11,7 +11,7 @@
<ControlTemplate x:Key="BadgeTextTemplate" TargetType="controls:Badge">
<controls:SimplePanel>
<ContentPresenter />
<Border x:Name="Border" RenderTransformOrigin="0.5 0.5" Style="{StaticResource BorderCircular}" Margin="{TemplateBinding BadgeMargin}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<Border x:Name="Border" Visibility="{TemplateBinding ShowBadge,Converter={StaticResource Boolean2VisibilityConverter}}" RenderTransformOrigin="0.5 0.5" Style="{StaticResource BorderCircular}" Margin="{TemplateBinding BadgeMargin}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}">
<Border.RenderTransform>
<ScaleTransform />
</Border.RenderTransform>
@ -33,14 +33,14 @@
<ControlTemplate x:Key="BadgeDotTemplate" TargetType="controls:Badge">
<controls:SimplePanel>
<ContentPresenter />
<Border Margin="{TemplateBinding BadgeMargin}" Width="10" Height="10" CornerRadius="5" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" />
<Border Visibility="{TemplateBinding ShowBadge,Converter={StaticResource Boolean2VisibilityConverter}}" Margin="{TemplateBinding BadgeMargin}" Width="10" Height="10" CornerRadius="5" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" />
</controls:SimplePanel>
</ControlTemplate>
<ControlTemplate x:Key="BadgeProcessingTemplate" TargetType="controls:Badge">
<controls:SimplePanel>
<ContentPresenter />
<Ellipse Height="10" Width="10" Fill="{TemplateBinding Background}" RenderTransformOrigin="0.5 0.5" Margin="{TemplateBinding BadgeMargin}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
<Ellipse Visibility="{TemplateBinding ShowBadge,Converter={StaticResource Boolean2VisibilityConverter}}" Height="10" Width="10" Fill="{TemplateBinding Background}" RenderTransformOrigin="0.5 0.5" Margin="{TemplateBinding BadgeMargin}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
<Ellipse.OpacityMask>
<RadialGradientBrush>
<GradientStop Offset="0" Color="Transparent" />
@ -62,7 +62,7 @@
</EventTrigger>
</Ellipse.Triggers>
</Ellipse>
<Border Margin="{TemplateBinding BadgeMargin}" Width="10" Height="10" CornerRadius="5" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" />
<Border Visibility="{TemplateBinding ShowBadge,Converter={StaticResource Boolean2VisibilityConverter}}" Margin="{TemplateBinding BadgeMargin}" Width="10" Height="10" CornerRadius="5" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" />
</controls:SimplePanel>
</ControlTemplate>

View File

@ -14,7 +14,7 @@
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="MinHeight" Value="32"/>
<Setter Property="MinHeight" Value="{StaticResource DefaultControlHeight}"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Expander">

View File

@ -4,6 +4,7 @@
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="BaseStyle.xaml"/>
<ResourceDictionary Source="../../Basic/Sizes.xaml"/>
</ResourceDictionary.MergedDictionaries>
<!--默认ListBoxItem样式-->
@ -11,7 +12,7 @@
<Setter Property="FocusVisualStyle" Value="{StaticResource FocusVisualRadius0Margin0}"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="Padding" Value="10,0"/>
<Setter Property="MinHeight" Value="32"/>
<Setter Property="MinHeight" Value="{StaticResource DefaultControlHeight}"/>
<Setter Property="HorizontalContentAlignment" Value="{Binding HorizontalContentAlignment, RelativeSource={RelativeSource AncestorType=ItemsControl}}"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>

View File

@ -19,15 +19,6 @@
<Setter Property="ShowActivated" Value="False"/>
<Setter Property="ShowInTaskbar" Value="False"/>
<Setter Property="Topmost" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="controls:GrowlWindow">
<controls:ScrollViewer VerticalScrollBarVisibility="Hidden" IsEnableInertia="True">
<StackPanel Name="PART_GrowPanel" VerticalAlignment="Top" Margin="0,10,10,10"/>
</controls:ScrollViewer>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="controls:Growl">
@ -56,7 +47,7 @@
<RowDefinition/>
<RowDefinition Height="Auto"/>
</Grid.RowDefinitions>
<Border Grid.ColumnSpan="3" Grid.RowSpan="2" Effect="{StaticResource EffectShadow2}" Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" Width="320"/>
<Border Grid.ColumnSpan="3" Grid.RowSpan="2" Effect="{StaticResource EffectShadow2}" Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}"/>
<Path Grid.Row="0" Grid.Column="0" VerticalAlignment="Top" Margin="0,15,0,0" Width="30" Height="30" Data="{TemplateBinding Icon}" Stretch="Uniform" Fill="{TemplateBinding IconBrush}"/>
<StackPanel VerticalAlignment="Center" Grid.Row="0" Grid.Column="1" Margin="0,10,10,10">
<TextBlock Text="{TemplateBinding Message}" Style="{StaticResource TextBlockDefault}" HorizontalAlignment="Left" TextWrapping="Wrap"/>
@ -65,14 +56,14 @@
<Button Grid.Row="0" Visibility="Collapsed" Margin="11,0" Name="PART_ButtonClose" Command="interactivity:ControlCommands.Close" Grid.Column="2" Background="Transparent" Style="{StaticResource ButtonCustom}" VerticalAlignment="Center" HorizontalAlignment="Center" Width="18" Height="18">
<Path Data="{StaticResource ErrorGeometry}" Stretch="Uniform" Fill="{DynamicResource SecondaryTextBrush}"/>
</Button>
<StackPanel Name="PART_PanelMore" IsEnabled="False" Visibility="Collapsed" Orientation="Horizontal" Grid.Row="1" Grid.ColumnSpan="3" Height="28" Grid.Column="0">
<Button Command="interactivity:ControlCommands.Cancel" Style="{StaticResource ButtonCustom}" Width="160">
<UniformGrid Columns="2" Name="PART_PanelMore" IsEnabled="False" Visibility="Collapsed" Grid.Row="1" Grid.ColumnSpan="3" Height="28" Grid.Column="0">
<Button Command="interactivity:ControlCommands.Cancel" Style="{StaticResource ButtonCustom}" HorizontalAlignment="Stretch" Background="Transparent">
<TextBlock Text="{Binding CancelStr,RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="Center" Foreground="{DynamicResource DangerBrush}"/>
</Button>
<Button Command="interactivity:ControlCommands.Confirm" Style="{StaticResource ButtonCustom}" Width="160">
<Button Command="interactivity:ControlCommands.Confirm" Style="{StaticResource ButtonCustom}" HorizontalAlignment="Stretch" Background="Transparent">
<TextBlock Text="{Binding ConfirmStr,RelativeSource={RelativeSource TemplatedParent}}" HorizontalAlignment="Center" Foreground="{DynamicResource PrimaryBrush}"/>
</Button>
</StackPanel>
</UniformGrid>
</Grid>
</ControlTemplate>
</Setter.Value>

View File

@ -55,9 +55,8 @@ namespace HandyControl.Tools.Converter
if (destinationType == null) throw new ArgumentNullException(nameof(destinationType));
if (!(value is ColLayout)) throw new ArgumentException("UnexpectedParameterType");
if (!(value is ColLayout th)) throw new ArgumentException("UnexpectedParameterType");
var th = (ColLayout)value;
if (destinationType == typeof(string)) return ToString(th, cultureInfo);
if (destinationType == typeof(InstanceDescriptor))
{

View File

@ -30,11 +30,11 @@ namespace HandyControl.Tools.Converter
}
catch
{
return new SolidColorBrush(default(Color));
return new SolidColorBrush(default);
}
return new SolidColorBrush(default(Color));
return new SolidColorBrush(default);
}
return new SolidColorBrush(default(Color));
return new SolidColorBrush(default);
}
}
}

View File

@ -0,0 +1,31 @@
using System;
using System.Globalization;
using System.Windows.Data;
using HandyControl.Tools.Extension;
namespace HandyControl.Tools.Converter
{
public class DoubleMinConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
if (value is double doubleValue)
{
if (parameter is string str)
{
var minValue = str.Value<double>();
return doubleValue < minValue ? minValue : doubleValue;
}
return doubleValue < .0 ? .0 : doubleValue;
}
return .0;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}

View File

@ -13,7 +13,7 @@ namespace HandyControl.Tools.Extension
}
catch
{
return default(T);
return default;
}
}

View File

@ -47,7 +47,7 @@ namespace HandyControl.Tools
return resource;
}
return default(T);
return default;
}
/// <summary>

View File

@ -21,7 +21,7 @@ namespace HandyControl.Tools
{
var typeStr = typeof(T).FullName;
if (string.IsNullOrEmpty(typeStr)) return default(T);
if (string.IsNullOrEmpty(typeStr)) return default;
var temp = new T();
if (!OpenDic.Keys.Contains(typeStr))
@ -36,7 +36,7 @@ namespace HandyControl.Tools
OpenDic[typeStr] = temp;
return temp;
}
return default(T);
return default;
}
}
}