add BlurWindow
This commit is contained in:
1 parent
939d776b36
commit
7a6f293011
45 files changed
+387
-110
No files matched your search
@@ -16,7 +16,7 @@ namespace HandyControl.Controls
|
||||
=> (Geometry) element.GetValue(GeometryProperty);
|
||||
|
||||
public static readonly DependencyProperty WidthProperty = DependencyProperty.RegisterAttached(
|
||||
"Width", typeof(double), typeof(IconElement), new PropertyMetadata(ValueBoxes.Double0Box));
|
||||
"Width", typeof(double), typeof(IconElement), new PropertyMetadata(double.NaN));
|
||||
|
||||
public static void SetWidth(DependencyObject element, double value)
|
||||
=> element.SetValue(WidthProperty, value);
|
||||
@@ -25,7 +25,7 @@ namespace HandyControl.Controls
|
||||
=> (double) element.GetValue(WidthProperty);
|
||||
|
||||
public static readonly DependencyProperty HeightProperty = DependencyProperty.RegisterAttached(
|
||||
"Height", typeof(double), typeof(IconElement), new PropertyMetadata(ValueBoxes.Double0Box));
|
||||
"Height", typeof(double), typeof(IconElement), new PropertyMetadata(double.NaN));
|
||||
|
||||
public static void SetHeight(DependencyObject element, double value)
|
||||
=> element.SetValue(HeightProperty, value);
|
||||
|
||||
@@ -3,21 +3,8 @@ using System.Windows.Media;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class IconSwitchElement
|
||||
public class IconSwitchElement : IconElement
|
||||
{
|
||||
public static readonly DependencyProperty GeometryProperty = DependencyProperty.RegisterAttached(
|
||||
"Geometry", typeof(Geometry), typeof(IconSwitchElement), new PropertyMetadata(default(Geometry)));
|
||||
|
||||
public static void SetGeometry(DependencyObject element, Geometry value)
|
||||
{
|
||||
element.SetValue(GeometryProperty, value);
|
||||
}
|
||||
|
||||
public static Geometry GetGeometry(DependencyObject element)
|
||||
{
|
||||
return (Geometry)element.GetValue(GeometryProperty);
|
||||
}
|
||||
|
||||
public static readonly DependencyProperty GeometrySelectedProperty = DependencyProperty.RegisterAttached(
|
||||
"GeometrySelected", typeof(Geometry), typeof(IconSwitchElement), new PropertyMetadata(default(Geometry)));
|
||||
|
||||
|
||||
@@ -675,7 +675,7 @@ namespace HandyControl.Controls
|
||||
|
||||
private void ButtonCancel_OnClick(object sender, RoutedEventArgs e) => RaiseEvent(new RoutedEventArgs(CanceledEvent));
|
||||
|
||||
public void Dispose() => Window.GetWindow(this)?.Close();
|
||||
public void Dispose() => System.Windows.Window.GetWindow(this)?.Close();
|
||||
|
||||
public bool CanDispose { get; } = true;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,53 @@
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Windows.Interop;
|
||||
using HandyControl.Data;
|
||||
using HandyControl.Tools;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
public class BlurWindow : Window
|
||||
{
|
||||
public override void OnApplyTemplate()
|
||||
{
|
||||
base.OnApplyTemplate();
|
||||
EnableBlur(this);
|
||||
}
|
||||
|
||||
internal static void EnableBlur(Window window)
|
||||
{
|
||||
var accentPolicy = new ExternDllHelper.ACCENTPOLICY();
|
||||
var accentPolicySize = Marshal.SizeOf(accentPolicy);
|
||||
var versionInfo = CommonHelper.GetSystemVersionInfo();
|
||||
|
||||
if (versionInfo >= SystemVersionInfo.Windows10_1809)
|
||||
{
|
||||
accentPolicy.AccentState = ExternDllHelper.ACCENTSTATE.ACCENT_ENABLE_ACRYLICBLURBEHIND;
|
||||
}
|
||||
else if (versionInfo >= SystemVersionInfo.Windows10)
|
||||
{
|
||||
accentPolicy.AccentState = ExternDllHelper.ACCENTSTATE.ACCENT_ENABLE_BLURBEHIND;
|
||||
}
|
||||
else
|
||||
{
|
||||
accentPolicy.AccentState = ExternDllHelper.ACCENTSTATE.ACCENT_ENABLE_TRANSPARENTGRADIENT;
|
||||
}
|
||||
|
||||
accentPolicy.AccentFlags = 2;
|
||||
accentPolicy.GradientColor = ResourceHelper.GetResource<uint>("BlurGradientValue");
|
||||
|
||||
var accentPtr = Marshal.AllocHGlobal(accentPolicySize);
|
||||
Marshal.StructureToPtr(accentPolicy, accentPtr, false);
|
||||
|
||||
var data = new ExternDllHelper.WINCOMPATTRDATA
|
||||
{
|
||||
Attribute = ExternDllHelper.WINDOWCOMPOSITIONATTRIB.WCA_ACCENT_POLICY,
|
||||
DataSize = accentPolicySize,
|
||||
Data = accentPtr
|
||||
};
|
||||
|
||||
ExternDllHelper.SetWindowCompositionAttribute(new WindowInteropHelper(window).Handle, ref data);
|
||||
|
||||
Marshal.FreeHGlobal(accentPtr);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,7 +14,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
[TemplatePart(Name = ElementGridTop, Type = typeof(Grid))]
|
||||
[TemplatePart(Name = ElementImageViewer, Type = typeof(ImageViewer))]
|
||||
public class ImageBrowser : WindowBorderless
|
||||
public class ImageBrowser : Window
|
||||
{
|
||||
#region Constants
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ namespace HandyControl.Controls
|
||||
/// </summary>
|
||||
[TemplatePart(Name = ElementMainBorder, Type = typeof(Border))]
|
||||
[TemplatePart(Name = ElementTitleBlock, Type = typeof(TextBlock))]
|
||||
public class PopupWindow : Window
|
||||
public class PopupWindow : System.Windows.Window
|
||||
{
|
||||
#region Constants
|
||||
|
||||
@@ -98,7 +98,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}
|
||||
|
||||
public PopupWindow(Window owner) : this() => Owner = owner;
|
||||
public PopupWindow(System.Windows.Window owner) : this() => Owner = owner;
|
||||
|
||||
private void CloseButton_OnClick(object sender, RoutedEventArgs e) => Close();
|
||||
|
||||
@@ -173,7 +173,7 @@ namespace HandyControl.Controls
|
||||
ShowDialog();
|
||||
}
|
||||
|
||||
public void Show(Window element, Point point)
|
||||
public void Show(System.Windows.Window element, Point point)
|
||||
{
|
||||
Left = element.Left + point.X;
|
||||
Top = element.Top + point.Y;
|
||||
|
||||
+21
-24
@@ -14,71 +14,68 @@ using System.Windows.Shell;
|
||||
|
||||
namespace HandyControl.Controls
|
||||
{
|
||||
/// <summary>
|
||||
/// 无边框窗口
|
||||
/// </summary>
|
||||
public class WindowBorderless : Window
|
||||
public class Window : System.Windows.Window
|
||||
{
|
||||
private Thickness _tempThickness;
|
||||
|
||||
public static readonly DependencyProperty NonClientAreaContentProperty = DependencyProperty.Register(
|
||||
"NonClientAreaContent", typeof(object), typeof(WindowBorderless), new PropertyMetadata(default(object)));
|
||||
"NonClientAreaContent", typeof(object), typeof(Window), new PropertyMetadata(default(object)));
|
||||
|
||||
public static readonly DependencyProperty CloseButtonHoverBackgroundProperty = DependencyProperty.Register(
|
||||
"CloseButtonHoverBackground", typeof(Brush), typeof(WindowBorderless),
|
||||
"CloseButtonHoverBackground", typeof(Brush), typeof(Window),
|
||||
new PropertyMetadata(default(Brush)));
|
||||
|
||||
public static readonly DependencyProperty CloseButtonHoverForegroundProperty =
|
||||
DependencyProperty.Register(
|
||||
"CloseButtonHoverForeground", typeof(Brush), typeof(WindowBorderless),
|
||||
"CloseButtonHoverForeground", typeof(Brush), typeof(Window),
|
||||
new PropertyMetadata(default(Brush)));
|
||||
|
||||
public static readonly DependencyProperty CloseButtonBackgroundProperty = DependencyProperty.Register(
|
||||
"CloseButtonBackground", typeof(Brush), typeof(WindowBorderless), new PropertyMetadata(Brushes.Transparent));
|
||||
"CloseButtonBackground", typeof(Brush), typeof(Window), new PropertyMetadata(Brushes.Transparent));
|
||||
|
||||
public static readonly DependencyProperty CloseButtonForegroundProperty = DependencyProperty.Register(
|
||||
"CloseButtonForeground", typeof(Brush), typeof(WindowBorderless),
|
||||
"CloseButtonForeground", typeof(Brush), typeof(Window),
|
||||
new PropertyMetadata(Brushes.White));
|
||||
|
||||
public static readonly DependencyProperty OtherButtonBackgroundProperty = DependencyProperty.Register(
|
||||
"OtherButtonBackground", typeof(Brush), typeof(WindowBorderless), new PropertyMetadata(Brushes.Transparent));
|
||||
"OtherButtonBackground", typeof(Brush), typeof(Window), new PropertyMetadata(Brushes.Transparent));
|
||||
|
||||
public static readonly DependencyProperty OtherButtonForegroundProperty = DependencyProperty.Register(
|
||||
"OtherButtonForeground", typeof(Brush), typeof(WindowBorderless),
|
||||
"OtherButtonForeground", typeof(Brush), typeof(Window),
|
||||
new PropertyMetadata(Brushes.White));
|
||||
|
||||
public static readonly DependencyProperty OtherButtonHoverBackgroundProperty = DependencyProperty.Register(
|
||||
"OtherButtonHoverBackground", typeof(Brush), typeof(WindowBorderless),
|
||||
"OtherButtonHoverBackground", typeof(Brush), typeof(Window),
|
||||
new PropertyMetadata(default(Brush)));
|
||||
|
||||
public static readonly DependencyProperty OtherButtonHoverForegroundProperty =
|
||||
DependencyProperty.Register(
|
||||
"OtherButtonHoverForeground", typeof(Brush), typeof(WindowBorderless),
|
||||
"OtherButtonHoverForeground", typeof(Brush), typeof(Window),
|
||||
new PropertyMetadata(default(Brush)));
|
||||
|
||||
public static readonly DependencyProperty NonClientAreaBackgroundProperty = DependencyProperty.Register(
|
||||
"NonClientAreaBackground", typeof(Brush), typeof(WindowBorderless),
|
||||
"NonClientAreaBackground", typeof(Brush), typeof(Window),
|
||||
new PropertyMetadata(default(Brush)));
|
||||
|
||||
public static readonly DependencyProperty NonClientAreaForegroundProperty = DependencyProperty.Register(
|
||||
"NonClientAreaForeground", typeof(Brush), typeof(WindowBorderless),
|
||||
"NonClientAreaForeground", typeof(Brush), typeof(Window),
|
||||
new PropertyMetadata(default(Brush)));
|
||||
|
||||
public static readonly DependencyProperty NonClientAreaHeightProperty = DependencyProperty.Register(
|
||||
"NonClientAreaHeight", typeof(double), typeof(WindowBorderless),
|
||||
"NonClientAreaHeight", typeof(double), typeof(Window),
|
||||
new PropertyMetadata(28.0));
|
||||
|
||||
public static readonly DependencyProperty ShowNonClientAreaProperty = DependencyProperty.Register(
|
||||
"ShowNonClientArea", typeof(bool), typeof(WindowBorderless), new PropertyMetadata(ValueBoxes.TrueBox));
|
||||
"ShowNonClientArea", typeof(bool), typeof(Window), new PropertyMetadata(ValueBoxes.TrueBox));
|
||||
|
||||
public static readonly DependencyProperty ShowTitleProperty = DependencyProperty.Register(
|
||||
"ShowTitle", typeof(bool), typeof(WindowBorderless), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||
"ShowTitle", typeof(bool), typeof(Window), new PropertyMetadata(ValueBoxes.FalseBox));
|
||||
|
||||
public static readonly DependencyProperty IsFullScreenProperty = DependencyProperty.Register(
|
||||
"IsFullScreen", typeof(bool), typeof(WindowBorderless), new PropertyMetadata(ValueBoxes.FalseBox,
|
||||
"IsFullScreen", typeof(bool), typeof(Window), new PropertyMetadata(ValueBoxes.FalseBox,
|
||||
(o, args) =>
|
||||
{
|
||||
var ctl = (WindowBorderless)o;
|
||||
var ctl = (Window)o;
|
||||
var v = (bool)args.NewValue;
|
||||
if (v)
|
||||
{
|
||||
@@ -99,7 +96,7 @@ namespace HandyControl.Controls
|
||||
}
|
||||
}));
|
||||
|
||||
public WindowBorderless()
|
||||
public Window()
|
||||
{
|
||||
var chrome = new WindowChrome
|
||||
{
|
||||
@@ -277,11 +274,11 @@ namespace HandyControl.Controls
|
||||
/// 获取自定义窗口
|
||||
/// </summary>
|
||||
/// <returns></returns>
|
||||
public static WindowBorderless GetCustomWindow(FrameworkElement content)
|
||||
public static Window GetCustomWindow(FrameworkElement content)
|
||||
{
|
||||
var window = new WindowBorderless
|
||||
var window = new Window
|
||||
{
|
||||
Style = ResourceHelper.GetResource<Style>(ResourceToken.CustomWindowStyle),
|
||||
Style = ResourceHelper.GetResource<Style>(ResourceToken.WindowWin10),
|
||||
Content = content
|
||||
};
|
||||
window.Loaded += (s, e) =>
|
||||
@@ -34,7 +34,7 @@
|
||||
|
||||
public static readonly string PaginationButtonStyle = nameof(PaginationButtonStyle);
|
||||
|
||||
public static readonly string CustomWindowStyle = nameof(CustomWindowStyle);
|
||||
public static readonly string WindowWin10 = nameof(WindowWin10);
|
||||
|
||||
public static readonly string AddTagButtonStyle = nameof(AddTagButtonStyle);
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ var styleList = new List<string>
|
||||
{
|
||||
"ButtonCustom",
|
||||
"PaginationButtonStyle",
|
||||
"CustomWindowStyle",
|
||||
"WindowWin10",
|
||||
"AddTagButtonStyle",
|
||||
"RadioGroupItemDefault",
|
||||
"RadioGroupItemSingle",
|
||||
|
||||
@@ -0,0 +1,76 @@
|
||||
// reference from https://github.com/sourcechord/FluentWPF/blob/master/FluentWPF/Utility/VersionInfo.cs
|
||||
// LICENSE: https://github.com/sourcechord/FluentWPF/blob/master/LICENSE
|
||||
|
||||
using System;
|
||||
|
||||
namespace HandyControl.Data
|
||||
{
|
||||
public struct SystemVersionInfo
|
||||
{
|
||||
public static SystemVersionInfo Windows10 => new SystemVersionInfo(10, 0, 10240);
|
||||
public static SystemVersionInfo Windows10_1809 => new SystemVersionInfo(10, 0, 17763);
|
||||
|
||||
public SystemVersionInfo(int major, int minor, int build)
|
||||
{
|
||||
Major = major;
|
||||
Minor = minor;
|
||||
Build = build;
|
||||
}
|
||||
|
||||
public int Major { get; }
|
||||
|
||||
public int Minor { get; }
|
||||
|
||||
public int Build { get; }
|
||||
|
||||
public bool Equals(SystemVersionInfo other) => Major == other.Major && Minor == other.Minor && Build == other.Build;
|
||||
|
||||
public override bool Equals(object obj) => obj is SystemVersionInfo other && Equals(other);
|
||||
|
||||
public override int GetHashCode() => Major.GetHashCode() ^ Minor.GetHashCode() ^ Build.GetHashCode();
|
||||
|
||||
public static bool operator ==(SystemVersionInfo left, SystemVersionInfo right) => left.Equals(right);
|
||||
|
||||
public static bool operator !=(SystemVersionInfo left, SystemVersionInfo right) => !(left == right);
|
||||
|
||||
public int CompareTo(SystemVersionInfo other)
|
||||
{
|
||||
if (Major != other.Major)
|
||||
{
|
||||
return Major.CompareTo(other.Major);
|
||||
}
|
||||
|
||||
if (Minor != other.Minor)
|
||||
{
|
||||
return Minor.CompareTo(other.Minor);
|
||||
}
|
||||
|
||||
if (Build != other.Build)
|
||||
{
|
||||
return Build.CompareTo(other.Build);
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
public int CompareTo(object obj)
|
||||
{
|
||||
if (!(obj is SystemVersionInfo other))
|
||||
{
|
||||
throw new ArgumentException();
|
||||
}
|
||||
|
||||
return CompareTo(other);
|
||||
}
|
||||
|
||||
public static bool operator <(SystemVersionInfo left, SystemVersionInfo right) => left.CompareTo(right) < 0;
|
||||
|
||||
public static bool operator <=(SystemVersionInfo left, SystemVersionInfo right) => left.CompareTo(right) <= 0;
|
||||
|
||||
public static bool operator >(SystemVersionInfo left, SystemVersionInfo right) => left.CompareTo(right) > 0;
|
||||
|
||||
public static bool operator >=(SystemVersionInfo left, SystemVersionInfo right) => left.CompareTo(right) >= 0;
|
||||
|
||||
public override string ToString() => $"{Major}.{Minor}.{Build}";
|
||||
}
|
||||
}
|
||||
@@ -143,6 +143,7 @@
|
||||
<Compile Include="Controls\StepBar\StepBarItem.cs" />
|
||||
<Compile Include="Controls\Time\FlipClock\FlipClock.cs" />
|
||||
<Compile Include="Controls\Time\FlipClock\FlipNumber.cs" />
|
||||
<Compile Include="Controls\Window\BlurWindow.cs" />
|
||||
<Compile Include="Data\Args\CancelRoutedEventArgs.cs" />
|
||||
<Compile Include="Data\Enum\InfoType.cs" />
|
||||
<Compile Include="Data\Enum\ResultType.cs" />
|
||||
@@ -154,6 +155,7 @@
|
||||
<Compile Include="Data\Gif\GifPropertyItem.cs" />
|
||||
<Compile Include="Data\Gif\GifPropertyItemInternal.cs" />
|
||||
<Compile Include="Data\Gif\GPStream.cs" />
|
||||
<Compile Include="Data\SystemVersionInfo.cs" />
|
||||
<Compile Include="Tools\Converter\Boolean2StrConverter.cs" />
|
||||
<Compile Include="Tools\Converter\Int2StrConverter.cs" />
|
||||
<Compile Include="Tools\Helper\ColorHelper.cs" />
|
||||
@@ -198,6 +200,7 @@
|
||||
<Compile Include="Expression\Media\UnitType.cs" />
|
||||
<Compile Include="Expression\Shapes\Arc.cs" />
|
||||
<Compile Include="Expression\Shapes\PrimitiveShape.cs" />
|
||||
<Compile Include="Tools\Helper\CommonHelper.cs" />
|
||||
<Compile Include="Tools\Helper\ExternDllHelper.cs" />
|
||||
<Compile Include="Tools\Helper\SingleOpenHelper.cs" />
|
||||
<Compile Include="Controls\TabControl\TabControl.cs" />
|
||||
@@ -210,7 +213,7 @@
|
||||
<Compile Include="Controls\Input\WatermarkTextBox.cs" />
|
||||
<Compile Include="Controls\Window\ImageBrowser.cs" />
|
||||
<Compile Include="Controls\Window\PopupWindow.cs" />
|
||||
<Compile Include="Controls\Window\WindowBorderless.cs" />
|
||||
<Compile Include="Controls\Window\Window.cs" />
|
||||
<Compile Include="Data\ValueBoxes.cs" />
|
||||
<Compile Include="Data\ColorRange.cs" />
|
||||
<Compile Include="Data\Enum\IpType.cs" />
|
||||
@@ -664,6 +667,7 @@
|
||||
<Reference Include="PresentationCore" />
|
||||
<Reference Include="PresentationFramework" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Management" />
|
||||
<Reference Include="System.Xaml" />
|
||||
<Reference Include="WindowsBase" />
|
||||
</ItemGroup>
|
||||
@@ -694,6 +698,9 @@
|
||||
<ItemGroup>
|
||||
<Service Include="{508349B6-6B84-4DF5-91F0-309BEEBAD82D}" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<PropertyGroup>
|
||||
<PreBuildEvent>
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
<Color x:Key="PrimaryColor">#73a5ff</Color>
|
||||
<Color x:Key="DarkPrimaryColor">#5477f5</Color>
|
||||
@@ -39,5 +40,6 @@
|
||||
|
||||
<Color x:Key="DarkMaskColor">#20000000</Color>
|
||||
<Color x:Key="DarkOpacityColor">#40000000</Color>
|
||||
<system:UInt32 x:Key="BlurGradientValue">0x99FFFFFF</system:UInt32>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -1,5 +1,6 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
<Color x:Key="PrimaryColor">#73a5ff</Color>
|
||||
<Color x:Key="DarkPrimaryColor">#5477f5</Color>
|
||||
@@ -39,5 +40,6 @@
|
||||
|
||||
<Color x:Key="DarkMaskColor">#40000000</Color>
|
||||
<Color x:Key="DarkOpacityColor">#40000000</Color>
|
||||
<system:UInt32 x:Key="BlurGradientValue">0x99000000</system:UInt32>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -1,5 +1,6 @@
|
||||
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:system="clr-namespace:System;assembly=mscorlib">
|
||||
|
||||
<Color x:Key="PrimaryColor">#ba68c8</Color>
|
||||
<Color x:Key="DarkPrimaryColor">#7b1fa2</Color>
|
||||
@@ -39,5 +40,6 @@
|
||||
|
||||
<Color x:Key="DarkMaskColor">#20000000</Color>
|
||||
<Color x:Key="DarkOpacityColor">#40000000</Color>
|
||||
<system:UInt32 x:Key="BlurGradientValue">0x99FFFFFF</system:UInt32>
|
||||
|
||||
</ResourceDictionary>
|
||||
@@ -4,7 +4,7 @@
|
||||
<Geometry x:Key="CalendarGeometry">M377.897477 116.291025l265.298718 0 0 47.459125-265.298718 0 0-47.459125ZM888.317416 116.291025 748.229288 116.291025l0 47.459125 123.54866 0c18.167626 0 32.894732 14.727106 32.894732 32.894732l0 92.92987L115.42936 289.574752l0-92.92987c0-18.167626 14.727106-32.894732 32.894732-32.894732l123.54866 0 0-47.459125L131.776437 116.291025c-35.244356 0-63.814389 28.571056-63.814389 63.815412l0.004093 713.966329c0 35.243333 28.571056 63.814389 63.814389 63.814389l756.540979 0c35.244356 0 63.814389-28.571056 63.814389-63.815412l-0.004093-713.966329C952.131805 144.861058 923.560749 116.291025 888.317416 116.291025zM904.67268 337.033877l0 540.498398c0 18.167626-14.727106 32.894732-32.894732 32.894732L148.324092 910.427007c-18.167626 0-32.894732-14.727106-32.894732-32.894732L115.42936 337.033877 904.67268 337.033877zM300.659736 64.801927l47.459125 0 0 170.241292-47.459125 0 0-170.241292ZM672.97481 64.801927l47.450938 0 0 170.241292-47.450938 0 0-170.241292ZM358.384138 547.939214l0 231.021432 52.863464 0L411.247602 459.226591l-34.580198 0-2.651514 3.804835c-18.000819 25.896006-41.448959 48.758786-69.681285 67.955908l-3.886703 2.643327 0 53.742526 13.441772-8.069156C330.690097 569.215794 345.588103 558.712075 358.384138 547.939214zM618.031888 726.552576c-10.287791 6.395971-24.435678 8.069156-42.059902 4.948946-16.094309-2.842881-27.898712-18.373321-35.082666-46.159464l-2.261615-8.753781-48.312603 13.424375 1.68956 8.129534c6.270098 30.168514 18.347737 52.052967 35.884976 65.017855 17.120734 12.705979 35.542152 19.777364 54.731087 21.043255 3.358652 0.225138 6.655903 0.337707 9.897892 0.337707 14.859119 0 28.430857-2.374184 40.452211-7.072408 14.417029-5.641758 26.88866-13.338413 37.076162-22.86278 10.365566-9.723922 18.230051-22.143362 23.378552-36.920612 4.918246-14.170401 7.739636-28.296797 8.385373-42.025108 0.60685-13.658723-0.667228-26.650218-3.791531-38.619382l-0.008187-0.017397c-3.111-11.777796-8.133628-23.738773-14.946104-35.551363-7.353831-12.679372-19.028268-22.750211-34.710165-29.952586-15.037183-6.872854-30.927843-10.685876-47.24729-11.32752-11.414505-0.415482-23.487027 1.386646-36.04462 5.434017 3.813022-14.568486 7.648557-31.884681 11.465673-51.775637l113.87693 0 0-49.357449L535.645647 464.492778l-1.495122 7.028404c-24.621928 115.77116-31.589954 145.497585-33.102473 150.039235l-3.432334 10.338958 45.829943 5.391036 3.054716-4.20292c8.146931-11.214951 18.247448-18.139996 30.879746-21.164011 13.004799-3.137607 24.743707-3.180588 34.879018-0.129966 9.857981 2.95545 17.822756 8.771178 24.327202 17.758284 6.512633 9.03111 10.084143 20.392401 10.617311 33.757421 0.519864 13.849067-1.603598 26.442477-6.314102 37.440476C636.315153 711.429431 628.843637 719.871089 618.031888 726.552576z</Geometry>
|
||||
<Geometry x:Key="DeleteGeometry">M512 620.544l253.3376 253.3376a76.6976 76.6976 0 1 0 108.544-108.544L620.6464 512l253.2352-253.3376a76.6976 76.6976 0 1 0-108.544-108.544L512 403.3536 258.6624 150.1184a76.6976 76.6976 0 1 0-108.544 108.544L403.3536 512 150.1184 765.3376a76.6976 76.6976 0 1 0 108.544 108.544L512 620.6464z</Geometry>
|
||||
<Geometry x:Key="DeleteFillCircleGeometry">M7.4038057,6.4038057 C7.1478834,6.4038057 6.8919611,6.5014372 6.6966991,6.6966991 6.3061748,7.0872235 6.3061748,7.7203884 6.6966991,8.1109123 L10.585787,12 6.6966991,15.889088 C6.3061748,16.279612 6.3061748,16.912777 6.6966991,17.303301 7.0872235,17.693825 7.7203879,17.693825 8.1109123,17.303301 L12,13.414213 15.889088,17.303301 C16.279612,17.693825 16.912777,17.693825 17.303301,17.303301 17.693825,16.912777 17.693825,16.279612 17.303301,15.889088 L13.414213,12 17.303301,8.1109123 C17.693825,7.7203884 17.693825,7.0872235 17.303301,6.6966991 16.912777,6.3061748 16.279612,6.3061748 15.889088,6.6966991 L12,10.585787 8.1109123,6.6966991 C7.9156504,6.5014372 7.6597281,6.4038057 7.4038057,6.4038057 z M12,0 C18.627417,0 24,5.3725829 24,12 24,18.627417 18.627417,24 12,24 5.3725829,24 0,18.627417 0,12 0,5.3725829 5.3725829,0 12,0 z</Geometry>
|
||||
<Geometry x:Key="CloseGeometry">M0.7071058,0 L5.3033001,4.5844099 9.8994934,0 10.606601,0.7052947 6.0104076,5.2897036 10.606601,9.8741154 9.8994934,10.57941 5.3033001,5.9949993 0.7071058,10.57941 1.6700275E-07,9.8741154 4.5961925,5.2897036 1.6700275E-07,0.7052947 z</Geometry>
|
||||
<Geometry x:Key="CloseGeometry">M0.7,0 L5,4.3 L9.3,0 L10,0.7 L5.7,5 L10,9.3 L9.3,10 L5,5.7 L0.7,10 L0,9.3 L4.3,5 L0,0.7 z</Geometry>
|
||||
<Geometry x:Key="DownGeometry">M512 801.6896L5.12 282.0096l58.1632-59.5968L512 682.3936l448.7168-460.0832 58.1632 59.5968-506.88 519.7824z</Geometry>
|
||||
<Geometry x:Key="UpGeometry">M50.000001,0 L100,51.262779 94.262627,57.141584 50.000001,11.767713 5.7373757,57.151686 0,51.27288 z</Geometry>
|
||||
<Geometry x:Key="ClockGeometry">M498.506684 256.571517 425.359734 256.571517 425.359734 622.190635 720.166063 622.190635 720.166063 549.725206 498.506684 549.725206ZM512.714268 80.162738c-245.740844 0-445.181175 197.577914-445.181175 441.024505s199.439308 441.024505 445.181175 441.024505c245.738797 0 445.178105-197.577914 445.178105-441.024505S758.453065 80.162738 512.714268 80.162738zM512.714268 874.005824c-195.880249 0-356.145349-158.768003-356.145349-352.818581s160.2651-352.821651 356.145349-352.821651c195.877179 0 356.14228 158.77005 356.14228 352.821651S708.591447 874.005824 512.714268 874.005824z</Geometry>
|
||||
@@ -20,9 +20,9 @@
|
||||
<Geometry x:Key="FullScreenReturnGeometry">M94.186081,59.07 L100,59.07 100,100 59.07,100 59.07,94.186081 94.186081,94.186081 z M4.5814285,58.208999 L41.791,58.208999 41.791,95.418571 35.977005,95.418571 35.977005,68.139304 4.1163101,100 0,95.88369 31.860695,64.022995 4.5814285,64.022995 z M95.88369,0 L100,4.1163101 68.139304,35.977005 95.418571,35.977005 95.418571,41.791 58.208999,41.791 58.208999,4.5814285 64.022995,4.5814285 64.022995,31.860695 z M0,0 L40.929998,0 40.929998,5.8139191 5.8139191,5.8139191 5.8139191,40.929998 0,40.929998 z</Geometry>
|
||||
<Geometry x:Key="SearchGeometry">M716.6003 213.800623c-138.851102-138.915088-364.020238-138.915088-502.935326 0s-138.915088 364.084225 0 502.935326a355.573996 355.573996 0 0 0 502.935326 0 355.573996 355.573996 0 0 0 0-502.935326z m-580.359212 580.359212a465.183184 465.183184 0 1 1 657.783099 0 465.183184 465.183184 0 0 1-657.783099 0z m868.939152 211.156054a63.474789 63.474789 0 0 1-89.837303 0l-89.773316-89.837303a63.410803 63.410803 0 1 1 89.773316-89.773316l89.837303 89.773316a63.346816 63.346816 0 0 1 0 89.837303z</Geometry>
|
||||
<Geometry x:Key="UpDownGeometry">M454.464 143.68l-253.44 253.44c-12.032 12.032-12.032 31.36 0 43.392 11.968 11.968 31.36 11.968 43.328 0l237.376-237.376 237.376 237.376c11.968 11.968 31.36 11.968 43.328 0 12.032-12.032 12.032-31.36 0-43.392l-253.44-253.44C491.264 126.016 478.016 124.032 454.464 143.68zM507.968 947.648l252.48-253.376c11.968-11.968 11.968-31.36 0-43.392-11.968-11.968-31.296-11.968-43.264 0l-236.48 237.376L244.16 650.88c-11.968-11.968-31.296-11.968-43.264 0-11.968 12.032-11.968 31.424 0 43.392l252.48 253.376C465.984 960 491.136 964.48 507.968 947.648z</Geometry>
|
||||
<Geometry x:Key="WindowMinGeometry">M0,0 L10,0 L10,1 L0,1 z</Geometry>
|
||||
<Geometry x:Key="WindowRestoreGeometry">M0.99999996,4.0419998 L0.99999996,12.042 9,12.042 9,4.0419998 z M3.958,1 L3.958,3.0420001 10,3.0420001 10,9 11.958,9 11.958,1 z M2.958,0 L12.958,0 12.958,10 10,10 10,13.042 0,13.042 0,3.0420001 2.958,3.0420001 z</Geometry>
|
||||
<Geometry x:Key="WindowMaxGeometry">M0.99999994,0.99999994 L0.99999994,9 9,9 9,0.99999994 z M0,0 L10,0 10,10 0,10 z</Geometry>
|
||||
<Geometry x:Key="WindowMinGeometry">M0,4 L10,4 L10,5 L0,5 z</Geometry>
|
||||
<Geometry x:Key="WindowRestoreGeometry">M1,3 L1,9 L7,9 L7,3 z M3,1 L3,2 L8,2 L8,7 L9,7 L9,1 z M2,0 L10,0 L10,8 L8,8 L8,10 L0,10 L0,2 L2,2 z</Geometry>
|
||||
<Geometry x:Key="WindowMaxGeometry">M1,1 L1,9 L9,9 L9,1 z M0,0 L10,0 L10,10 L0,10 z</Geometry>
|
||||
<Geometry x:Key="AddGeometry">M938.666667 426.666667h-341.333334V85.333333c0-46.933333-38.4-85.333333-85.333333-85.333333s-85.333333 38.4-85.333333 85.333333v341.333334H85.333333c-46.933333 0-85.333333 38.4-85.333333 85.333333s38.4 85.333333 85.333333 85.333333h341.333334v341.333334c0 46.933333 38.4 85.333333 85.333333 85.333333s85.333333-38.4 85.333333-85.333333v-341.333334h341.333334c46.933333 0 85.333333-38.4 85.333333-85.333333s-38.4-85.333333-85.333333-85.333333z</Geometry>
|
||||
<Geometry x:Key="SubGeometry">M62.5797 488.9508c0.2632 42.5185 34.985 77.2116 77.5035 77.5035l743.0216-0.6728c42.5185 0.3215 76.7437-33.9333 76.4518-76.4805l0 0c-0.2918-42.5175-34.985-77.2106-77.5045-77.5035l-743.0216-0.087C96.513 411.4473 62.2879 446.4323 62.5797 488.9508L62.5797 488.9508z</Geometry>
|
||||
<Geometry x:Key="WarningGeometry">M943.644188 827.215696l-351.176649-608.204749c-42.945473-74.36249-113.147387-74.36249-156.092861 0l-351.176649 608.204749c-42.946498 74.431167-7.811716 135.14955 78.012605 135.14955l702.420949 0C951.455904 962.36422 986.555836 901.645838 943.644188 827.215696zM466.187532 391.579035c12.621133-13.644108 28.66175-20.466675 48.233578-20.466675 19.580028 0 35.612444 6.75389 48.241778 20.194018 12.544256 13.473954 18.820484 30.325365 18.820484 50.587035 0 17.430551-26.19759 145.621205-34.929778 238.882082l-63.105666 0c-7.666162-93.259852-36.090106-221.450507-36.090106-238.882082C447.358847 421.938226 453.643275 405.155491 466.187532 391.579035zM561.76804 835.026386c-13.268949 12.928641-29.062535 19.375023-47.345906 19.375023-18.275171 0-34.076957-6.447407-47.346931-19.375023-13.235123-12.89379-19.818859-28.517221-19.818859-46.869269 0-18.249546 6.583736-34.043131 19.818859-47.278254 13.268949-13.235123 29.07176-19.852685 47.346931-19.852685 18.283371 0 34.076957 6.617562 47.345906 19.852685 13.235123 13.235123 19.827059 29.028709 19.827059 47.278254C581.595099 806.51019 575.003163 822.132597 561.76804 835.026386z</Geometry>
|
||||
|
||||
@@ -16,7 +16,7 @@
|
||||
<Border Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}">
|
||||
<Path x:Name="PathMain" Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Data="{TemplateBinding controls:IconElement.Geometry}"/>
|
||||
<Path x:Name="PathMain" Width="{TemplateBinding controls:IconElement.Width}" Height="{TemplateBinding controls:IconElement.Height}" Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Data="{TemplateBinding controls:IconElement.Geometry}"/>
|
||||
<ContentPresenter x:Name="ContentPresenterMain" VerticalAlignment="Center" Margin="6,0,0,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
@@ -82,7 +82,7 @@
|
||||
<Grid x:Name="TemplateRoot">
|
||||
<shapes:Arc ArcThickness="{TemplateBinding ArcThickness}" Stretch="None" EndAngle="360" Width="{TemplateBinding ActualWidth}" Height="{TemplateBinding ActualHeight}" Stroke="{TemplateBinding BorderBrush}" Fill="{TemplateBinding Background}" StrokeThickness="0"/>
|
||||
<shapes:Arc ArcThickness="{TemplateBinding ArcThickness}" Stretch="None" Width="{TemplateBinding ActualWidth}" StrokeThickness="0" Height="{TemplateBinding ActualHeight}" x:Name="PART_Indicator" Fill="{TemplateBinding Foreground}"/>
|
||||
<TextBlock Visibility="{Binding ShowText,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{DynamicResource PrimaruTextBrush}" Text="{Binding Value,RelativeSource={RelativeSource TemplatedParent},StringFormat={}{0} %}"/>
|
||||
<TextBlock Visibility="{Binding ShowText,RelativeSource={RelativeSource TemplatedParent},Converter={StaticResource Boolean2VisibilityConverter}}" HorizontalAlignment="Center" VerticalAlignment="Center" Foreground="{DynamicResource PrimaryTextBrush}" Text="{Binding Value,RelativeSource={RelativeSource TemplatedParent},StringFormat={}{0} %}"/>
|
||||
</Grid>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
|
||||
<Style x:Key="TabControlBaseStyle" TargetType="TabControl">
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="BorderThickness" Value="0"/>
|
||||
<Setter Property="Foreground" Value="White"/>
|
||||
<Setter Property="ItemContainerStyle" Value="{StaticResource TabItemStyle}"/>
|
||||
@@ -56,7 +57,7 @@
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="TabControl">
|
||||
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
|
||||
<Grid x:Name="templateRoot" Background="{DynamicResource RegionBrush}" ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
|
||||
<Grid x:Name="templateRoot" Background="{TemplateBinding Background}" ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition x:Name="ColumnDefinition0"/>
|
||||
<ColumnDefinition x:Name="ColumnDefinition1" Width="0"/>
|
||||
|
||||
@@ -17,7 +17,7 @@
|
||||
<Border Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<StackPanel Orientation="Horizontal" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}">
|
||||
<Path x:Name="PathMain" Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Data="{TemplateBinding controls:IconElement.Geometry}"/>
|
||||
<Path x:Name="PathMain" Width="{TemplateBinding controls:IconElement.Width}" Height="{TemplateBinding controls:IconElement.Height}" Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Data="{TemplateBinding controls:IconElement.Geometry}"/>
|
||||
<ContentPresenter x:Name="ContentPresenterMain" VerticalAlignment="Center" Margin="6,0,0,0" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"/>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
@@ -180,7 +180,7 @@
|
||||
<Border Background="{TemplateBinding Background}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}"/>
|
||||
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}">
|
||||
<ContentControl HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
|
||||
<Path x:Name="PathIcon" Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Data="{TemplateBinding controls:IconSwitchElement.Geometry}"/>
|
||||
<Path x:Name="PathIcon" Width="{TemplateBinding controls:IconElement.Width}" Height="{TemplateBinding controls:IconElement.Height}" Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Data="{TemplateBinding controls:IconSwitchElement.Geometry}"/>
|
||||
</ContentControl>
|
||||
</Border>
|
||||
<Border Visibility="Collapsed" CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" x:Name="BorderChecked" BorderThickness="4" BorderBrush="{TemplateBinding BorderBrush}"/>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<ControlTemplate TargetType="Button">
|
||||
<Border CornerRadius="{Binding Path=(controls:BorderElement.CornerRadius),RelativeSource={RelativeSource TemplatedParent}}" Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
|
||||
<ContentControl HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
|
||||
<Path Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Data="{TemplateBinding controls:IconElement.Geometry}"/>
|
||||
<Path Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Width="{TemplateBinding controls:IconElement.Width}" Height="{TemplateBinding controls:IconElement.Height}" Data="{TemplateBinding controls:IconElement.Geometry}"/>
|
||||
</ContentControl>
|
||||
</Border>
|
||||
</ControlTemplate>
|
||||
|
||||
@@ -73,6 +73,7 @@
|
||||
|
||||
<Style TargetType="controls:TabControl">
|
||||
<Setter Property="Padding" Value="0"/>
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="BorderBrush" Value="{DynamicResource BorderBrush}"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
<Setter Property="VerticalContentAlignment" Value="Center"/>
|
||||
@@ -90,7 +91,7 @@
|
||||
<RowDefinition x:Name="RowDefinition0" Height="Auto"/>
|
||||
<RowDefinition x:Name="RowDefinition1" Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Border Background="{DynamicResource RegionBrush}" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<Border Background="{TemplateBinding Background}" BorderThickness="0,0,0,1" BorderBrush="{DynamicResource BorderBrush}">
|
||||
<controls:TabPanel MinHeight="{TemplateBinding TabItemHeight}" TabItemHeight="{TemplateBinding TabItemHeight}" TabItemWidth="{TemplateBinding TabItemWidth}" IsEnableTabFill="{TemplateBinding IsEnableTabFill}" Margin="0,0,-1,-1" x:Name="PART_HeaderPanel" HorizontalAlignment="Left" Background="{DynamicResource SecondaryTextBrush}" IsItemsHost="true" KeyboardNavigation.TabIndex="1" Panel.ZIndex="1">
|
||||
<interactivity:Interaction.Behaviors>
|
||||
<interactivity:FluidMoveBehavior AppliesTo="Children" Duration="{Binding FluidMoveDuration,ElementName=PART_HeaderPanel}">
|
||||
@@ -126,7 +127,7 @@
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="TabControl">
|
||||
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
|
||||
<Grid x:Name="templateRoot" Background="{DynamicResource RegionBrush}" ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
|
||||
<Grid x:Name="templateRoot" Background="{TemplateBinding Background}" ClipToBounds="true" SnapsToDevicePixels="true" KeyboardNavigation.TabNavigation="Local">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition x:Name="ColumnDefinition0"/>
|
||||
<ColumnDefinition x:Name="ColumnDefinition1" Width="0"/>
|
||||
|
||||
@@ -85,7 +85,7 @@
|
||||
<ControlTemplate TargetType="ToggleButton">
|
||||
<Border Background="{TemplateBinding Background}" BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}">
|
||||
<ContentControl Margin="{TemplateBinding Padding}" SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
|
||||
<Path x:Name="PathIcon" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Data="{TemplateBinding controls:IconSwitchElement.Geometry}"/>
|
||||
<Path x:Name="PathIcon" Width="{TemplateBinding controls:IconElement.Width}" Height="{TemplateBinding controls:IconElement.Height}" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Fill="{TemplateBinding Foreground}" SnapsToDevicePixels="True" Stretch="Uniform" Data="{TemplateBinding controls:IconSwitchElement.Geometry}"/>
|
||||
</ContentControl>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
|
||||
@@ -14,18 +14,18 @@
|
||||
<ResourceDictionary Source="../Basic/Paths.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style x:Key="WindowDefaultStyle" BasedOn="{x:Null}" TargetType="Window">
|
||||
<Style x:Key="WindowDefault" BasedOn="{x:Null}" TargetType="Window">
|
||||
<Setter Property="Background" Value="{DynamicResource BackgroundBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CustomWindowStyle" BasedOn="{x:Null}" TargetType="controls:WindowBorderless">
|
||||
<Style x:Key="WindowWin10" BasedOn="{x:Null}" TargetType="controls:Window">
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="UseLayoutRounding" Value="True"/>
|
||||
<Setter Property="NonClientAreaBackground" Value="{DynamicResource TitleBrush}"/>
|
||||
<Setter Property="NonClientAreaForeground" Value="White"/>
|
||||
<Setter Property="CloseButtonHoverBackground" Value="Red"/>
|
||||
<Setter Property="CloseButtonHoverBackground" Value="#e71123"/>
|
||||
<Setter Property="CloseButtonHoverForeground" Value="White"/>
|
||||
<Setter Property="CloseButtonBackground" Value="Transparent"/>
|
||||
<Setter Property="OtherButtonHoverBackground" Value="{DynamicResource DarkPrimaryBrush}"/>
|
||||
@@ -33,7 +33,7 @@
|
||||
<Setter Property="OtherButtonBackground" Value="Transparent"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:WindowBorderless">
|
||||
<ControlTemplate TargetType="controls:Window">
|
||||
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
|
||||
<Grid Margin="{TemplateBinding Padding}">
|
||||
<Grid.RowDefinitions>
|
||||
@@ -46,10 +46,10 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel shell:WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="shell:SystemCommands.MinimizeWindowCommand" IsTabStop="False" shell:WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMin" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowMinGeometry}" BorderThickness="1,0" Padding="17,0"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="shell:SystemCommands.MaximizeWindowCommand" IsTabStop="False" shell:WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMax" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowMaxGeometry}" BorderThickness="1,0" Padding="17,0"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="shell:SystemCommands.RestoreWindowCommand" IsTabStop="False" shell:WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonRestore" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" BorderThickness="1,0" Padding="17,0"/>
|
||||
<Button Background="{TemplateBinding CloseButtonBackground}" Foreground="{TemplateBinding CloseButtonForeground}" Command="shell:SystemCommands.CloseWindowCommand" IsTabStop="False" shell:WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonClose" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource CloseGeometry}" BorderThickness="1,0,0,0" Padding="9"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="shell:SystemCommands.MinimizeWindowCommand" IsTabStop="False" shell:WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMin" Height="29" Style="{StaticResource ButtonIcon}" Width="45" controls:IconElement.Geometry="{StaticResource WindowMinGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="shell:SystemCommands.MaximizeWindowCommand" IsTabStop="False" shell:WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMax" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowMaxGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="shell:SystemCommands.RestoreWindowCommand" IsTabStop="False" shell:WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonRestore" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding CloseButtonBackground}" Foreground="{TemplateBinding CloseButtonForeground}" Command="shell:SystemCommands.CloseWindowCommand" IsTabStop="False" shell:WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonClose" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource CloseGeometry}" BorderThickness="1,0,0,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
</StackPanel>
|
||||
<Grid Grid.Column="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -135,6 +135,10 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="WindowBlur" BasedOn="{StaticResource WindowWin10}" TargetType="controls:BlurWindow">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="controls:PopupWindow">
|
||||
<Setter Property="WindowStyle" Value="None"/>
|
||||
<Setter Property="MinHeight" Value="220"/>
|
||||
|
||||
@@ -13,18 +13,18 @@
|
||||
<ResourceDictionary Source="../Basic/Paths.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style x:Key="WindowDefaultStyle" BasedOn="{x:Null}" TargetType="Window">
|
||||
<Style x:Key="WindowDefault" BasedOn="{x:Null}" TargetType="Window">
|
||||
<Setter Property="Background" Value="{DynamicResource BackgroundBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CustomWindowStyle" BasedOn="{x:Null}" TargetType="controls:WindowBorderless">
|
||||
<Style x:Key="WindowWin10" BasedOn="{x:Null}" TargetType="controls:Window">
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="UseLayoutRounding" Value="True"/>
|
||||
<Setter Property="NonClientAreaBackground" Value="{DynamicResource TitleBrush}"/>
|
||||
<Setter Property="NonClientAreaForeground" Value="White"/>
|
||||
<Setter Property="CloseButtonHoverBackground" Value="Red"/>
|
||||
<Setter Property="CloseButtonHoverBackground" Value="#e71123"/>
|
||||
<Setter Property="CloseButtonHoverForeground" Value="White"/>
|
||||
<Setter Property="CloseButtonBackground" Value="Transparent"/>
|
||||
<Setter Property="OtherButtonHoverBackground" Value="{DynamicResource DarkPrimaryBrush}"/>
|
||||
@@ -32,7 +32,7 @@
|
||||
<Setter Property="OtherButtonBackground" Value="Transparent"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:WindowBorderless">
|
||||
<ControlTemplate TargetType="controls:Window">
|
||||
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
|
||||
<Grid Margin="{TemplateBinding Padding}">
|
||||
<Grid.RowDefinitions>
|
||||
@@ -45,10 +45,10 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MinimizeWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMin" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowMinGeometry}" BorderThickness="1,0" Padding="17,0"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MaximizeWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMax" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowMaxGeometry}" BorderThickness="1,0" Padding="17,0"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.RestoreWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonRestore" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" BorderThickness="1,0" Padding="17,0"/>
|
||||
<Button Background="{TemplateBinding CloseButtonBackground}" Foreground="{TemplateBinding CloseButtonForeground}" Command="SystemCommands.CloseWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonClose" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource CloseGeometry}" BorderThickness="1,0,0,0" Padding="9.5"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MinimizeWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMin" Height="29" Style="{StaticResource ButtonIcon}" Width="45" controls:IconElement.Geometry="{StaticResource WindowMinGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MaximizeWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMax" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowMaxGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.RestoreWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonRestore" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding CloseButtonBackground}" Foreground="{TemplateBinding CloseButtonForeground}" Command="SystemCommands.CloseWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonClose" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource CloseGeometry}" BorderThickness="1,0,0,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
</StackPanel>
|
||||
<Grid Grid.Column="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -134,6 +134,10 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="WindowBlur" BasedOn="{StaticResource WindowWin10}" TargetType="controls:BlurWindow">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="controls:PopupWindow">
|
||||
<Setter Property="WindowStyle" Value="None"/>
|
||||
<Setter Property="MinHeight" Value="220"/>
|
||||
|
||||
@@ -13,18 +13,18 @@
|
||||
<ResourceDictionary Source="../Basic/Paths.xaml"/>
|
||||
</ResourceDictionary.MergedDictionaries>
|
||||
|
||||
<Style x:Key="WindowDefaultStyle" BasedOn="{x:Null}" TargetType="Window">
|
||||
<Style x:Key="WindowDefault" BasedOn="{x:Null}" TargetType="Window">
|
||||
<Setter Property="Background" Value="{DynamicResource BackgroundBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="CustomWindowStyle" BasedOn="{x:Null}" TargetType="controls:WindowBorderless">
|
||||
<Style x:Key="WindowWin10" BasedOn="{x:Null}" TargetType="controls:Window">
|
||||
<Setter Property="Background" Value="{DynamicResource RegionBrush}"/>
|
||||
<Setter Property="Foreground" Value="{DynamicResource PrimaryTextBrush}"/>
|
||||
<Setter Property="UseLayoutRounding" Value="True"/>
|
||||
<Setter Property="NonClientAreaBackground" Value="{DynamicResource TitleBrush}"/>
|
||||
<Setter Property="NonClientAreaForeground" Value="White"/>
|
||||
<Setter Property="CloseButtonHoverBackground" Value="Red"/>
|
||||
<Setter Property="CloseButtonHoverBackground" Value="#e71123"/>
|
||||
<Setter Property="CloseButtonHoverForeground" Value="White"/>
|
||||
<Setter Property="CloseButtonBackground" Value="Transparent"/>
|
||||
<Setter Property="OtherButtonHoverBackground" Value="{DynamicResource DarkPrimaryBrush}"/>
|
||||
@@ -32,7 +32,7 @@
|
||||
<Setter Property="OtherButtonBackground" Value="Transparent"/>
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="controls:WindowBorderless">
|
||||
<ControlTemplate TargetType="controls:Window">
|
||||
<Border BorderThickness="{TemplateBinding BorderThickness}" BorderBrush="{TemplateBinding BorderBrush}" Background="{TemplateBinding Background}">
|
||||
<Grid Margin="{TemplateBinding Padding}">
|
||||
<Grid.RowDefinitions>
|
||||
@@ -45,10 +45,10 @@
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel WindowChrome.IsHitTestVisibleInChrome="True" UseLayoutRounding="True" VerticalAlignment="Top" Grid.Column="1" HorizontalAlignment="Right" Orientation="Horizontal">
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MinimizeWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMin" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowMinGeometry}" BorderThickness="1,0" Padding="17,0"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MaximizeWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMax" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowMaxGeometry}" BorderThickness="1,0" Padding="17,0"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.RestoreWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonRestore" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" BorderThickness="1,0" Padding="17,0"/>
|
||||
<Button Background="{TemplateBinding CloseButtonBackground}" Foreground="{TemplateBinding CloseButtonForeground}" Command="SystemCommands.CloseWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonClose" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource CloseGeometry}" BorderThickness="1,0,0,0" Padding="9.5"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MinimizeWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMin" Height="29" Style="{StaticResource ButtonIcon}" Width="45" controls:IconElement.Geometry="{StaticResource WindowMinGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.MaximizeWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonMax" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowMaxGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding OtherButtonBackground}" Foreground="{TemplateBinding OtherButtonForeground}" Command="SystemCommands.RestoreWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonRestore" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource WindowRestoreGeometry}" BorderThickness="1,0,1,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
<Button Background="{TemplateBinding CloseButtonBackground}" Foreground="{TemplateBinding CloseButtonForeground}" Command="SystemCommands.CloseWindowCommand" IsTabStop="False" WindowChrome.IsHitTestVisibleInChrome="True" Name="ButtonClose" Height="29" Style="{StaticResource ButtonIcon}" Width="46" controls:IconElement.Geometry="{StaticResource CloseGeometry}" BorderThickness="1,0,0,0" controls:IconElement.Width="10" controls:IconElement.Height="10"/>
|
||||
</StackPanel>
|
||||
<Grid Grid.Column="0">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -134,6 +134,10 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="WindowBlur" BasedOn="{StaticResource WindowWin10}" TargetType="controls:BlurWindow">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
</Style>
|
||||
|
||||
<Style TargetType="controls:PopupWindow">
|
||||
<Setter Property="WindowStyle" Value="None"/>
|
||||
<Setter Property="MinHeight" Value="220"/>
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
using System.Linq;
|
||||
using System.Management;
|
||||
using HandyControl.Data;
|
||||
|
||||
namespace HandyControl.Tools
|
||||
{
|
||||
public class CommonHelper
|
||||
{
|
||||
public static SystemVersionInfo GetSystemVersionInfo()
|
||||
{
|
||||
var managementClass = new ManagementClass("Win32_OperatingSystem");
|
||||
var instances = managementClass.GetInstances();
|
||||
foreach (var instance in instances)
|
||||
{
|
||||
if (instance["Version"] is string version)
|
||||
{
|
||||
var nums = version.Split('.').Select(int.Parse).ToList();
|
||||
var info = new SystemVersionInfo(nums[0], nums[1], nums[2]);
|
||||
return info;
|
||||
}
|
||||
}
|
||||
return default(SystemVersionInfo);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -14,9 +14,46 @@ namespace HandyControl.Tools
|
||||
{
|
||||
private const string Gdi32 = "gdi32.dll";
|
||||
|
||||
private const string User32 = "user32.dll";
|
||||
|
||||
// ReSharper disable once InconsistentNaming
|
||||
public const int E_FAIL = unchecked((int) 0x80004005);
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal struct WINCOMPATTRDATA
|
||||
{
|
||||
public WINDOWCOMPOSITIONATTRIB Attribute;
|
||||
public IntPtr Data;
|
||||
public int DataSize;
|
||||
}
|
||||
|
||||
internal enum WINDOWCOMPOSITIONATTRIB
|
||||
{
|
||||
WCA_ACCENT_POLICY = 19
|
||||
}
|
||||
|
||||
internal enum ACCENTSTATE
|
||||
{
|
||||
ACCENT_DISABLED = 0,
|
||||
ACCENT_ENABLE_GRADIENT = 1,
|
||||
ACCENT_ENABLE_TRANSPARENTGRADIENT = 2,
|
||||
ACCENT_ENABLE_BLURBEHIND = 3,
|
||||
ACCENT_ENABLE_ACRYLICBLURBEHIND = 4,
|
||||
ACCENT_INVALID_STATE = 5
|
||||
}
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
internal struct ACCENTPOLICY
|
||||
{
|
||||
public ACCENTSTATE AccentState;
|
||||
public int AccentFlags;
|
||||
public uint GradientColor;
|
||||
public int AnimationId;
|
||||
}
|
||||
|
||||
[DllImport(User32)]
|
||||
internal static extern int SetWindowCompositionAttribute(IntPtr hwnd, ref WINCOMPATTRDATA data);
|
||||
|
||||
[ReflectionPermission(SecurityAction.Assert, Unrestricted = true), SecurityPermission(SecurityAction.Assert, Flags = SecurityPermissionFlag.UnmanagedCode)]
|
||||
public static object PtrToStructure(IntPtr lparam, Type cls) => Marshal.PtrToStructure(lparam, cls);
|
||||
|
||||
|
||||
@@ -40,7 +40,15 @@ namespace HandyControl.Tools
|
||||
/// </summary>
|
||||
/// <param name="key"></param>
|
||||
/// <returns></returns>
|
||||
public static T GetResource<T>(string key) where T : class => Application.Current.TryFindResource(key) as T;
|
||||
public static T GetResource<T>(string key)
|
||||
{
|
||||
if (Application.Current.TryFindResource(key) is T resource)
|
||||
{
|
||||
return resource;
|
||||
}
|
||||
|
||||
return default(T);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 获取HandyControl皮肤
|
||||
|
||||
@@ -49,6 +49,7 @@ namespace HandyControlDemo
|
||||
{
|
||||
Source = new Uri("pack://application:,,,/HandyControlDemo;component/Resources/Themes/Theme.xaml")
|
||||
});
|
||||
Current.MainWindow?.OnApplyTemplate();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -62,6 +62,8 @@
|
||||
|
||||
public static readonly string QQGroupView = nameof(QQGroupView);
|
||||
|
||||
public static readonly string BlurWindow = nameof(BlurWindow);
|
||||
|
||||
public static readonly string ButtonDemoCtl = nameof(ButtonDemoCtl);
|
||||
|
||||
public static readonly string ToggleButtonDemoCtl = nameof(ToggleButtonDemoCtl);
|
||||
|
||||
@@ -33,7 +33,8 @@ var controlList = new List<string>
|
||||
"GifImageDemoCtl",
|
||||
"OutlineTextDemoCtl",
|
||||
"FlipClockDemoCtl",
|
||||
"QQGroupView"
|
||||
"QQGroupView",
|
||||
"BlurWindow"
|
||||
};
|
||||
var styleList = new List<string>
|
||||
{
|
||||
|
||||
@@ -289,6 +289,9 @@
|
||||
<Compile Include="ViewModel\StepBarDemoViewModel.cs" />
|
||||
<Compile Include="ViewModel\ViewModelLocator.cs" />
|
||||
<Compile Include="ViewModel\WindowDemoViewModel.cs" />
|
||||
<Compile Include="Window\BlurWindow.xaml.cs">
|
||||
<DependentUpon>BlurWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Window\CommonWindow.xaml.cs">
|
||||
<DependentUpon>CommonWindow.xaml</DependentUpon>
|
||||
</Compile>
|
||||
@@ -595,6 +598,10 @@
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Window\BlurWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
</Page>
|
||||
<Page Include="Window\CommonWindow.xaml">
|
||||
<SubType>Designer</SubType>
|
||||
<Generator>MSBuild:Compile</Generator>
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
<controls:WindowBorderless x:Class="HandyControlDemo.MainWindow"
|
||||
<controls:BlurWindow x:Class="HandyControlDemo.MainWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
@@ -10,7 +10,7 @@
|
||||
BorderBrush="#262e2f"
|
||||
NonClientAreaBackground="#262e2f"
|
||||
OtherButtonHoverBackground="#888580"
|
||||
Style="{StaticResource CustomWindowStyle}"
|
||||
Style="{StaticResource WindowBlur}"
|
||||
WindowState="Maximized"
|
||||
Title="MainWindow"
|
||||
ResizeMode="CanResizeWithGrip"
|
||||
@@ -18,9 +18,9 @@
|
||||
DataContext="{Binding Main,Source={StaticResource Locator}}"
|
||||
d:DesignHeight="800"
|
||||
d:DesignWidth="1400">
|
||||
<controls:WindowBorderless.NonClientAreaContent>
|
||||
<controls:Window.NonClientAreaContent>
|
||||
<userControl:NoUserContent/>
|
||||
</controls:WindowBorderless.NonClientAreaContent>
|
||||
</controls:Window.NonClientAreaContent>
|
||||
<Grid>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="200" MinWidth="200" MaxWidth="400"/>
|
||||
@@ -33,4 +33,4 @@
|
||||
<StackPanel controls:Growl.GrowlParent="True" VerticalAlignment="Top" Margin="0,10,10,10"/>
|
||||
</controls:ScrollViewer>
|
||||
</Grid>
|
||||
</controls:WindowBorderless>
|
||||
</controls:BlurWindow>
|
||||
+10
-1
@@ -47,7 +47,7 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 使用此强类型资源类,为所有资源查找
|
||||
/// 重写当前线程的 CurrentUICulture 属性
|
||||
/// 重写当前线程的 CurrentUICulture 属性。
|
||||
/// </summary>
|
||||
[global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)]
|
||||
@@ -582,6 +582,15 @@ namespace HandyControlDemo.Properties.Langs {
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 点击打开背景模糊窗口 的本地化字符串。
|
||||
/// </summary>
|
||||
public static string OpenBlurWindow {
|
||||
get {
|
||||
return ResourceManager.GetString("OpenBlurWindow", resourceCulture);
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 查找类似 点击打开常规窗口 的本地化字符串。
|
||||
/// </summary>
|
||||
|
||||
@@ -441,4 +441,7 @@
|
||||
<data name="FlipClock" xml:space="preserve">
|
||||
<value>FlipClock</value>
|
||||
</data>
|
||||
<data name="OpenBlurWindow" xml:space="preserve">
|
||||
<value>open blur window</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -421,4 +421,7 @@
|
||||
<data name="FlipClock" xml:space="preserve">
|
||||
<value>翻页时钟</value>
|
||||
</data>
|
||||
<data name="OpenBlurWindow" xml:space="preserve">
|
||||
<value>点击打开背景模糊窗口</value>
|
||||
</data>
|
||||
</root>
|
||||
@@ -34,7 +34,11 @@
|
||||
</Setter>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ListBoxItemNew" BasedOn="{StaticResource ListBoxItemBaseStyle}" TargetType="ListBoxItem">
|
||||
<Style x:Key="ListBoxItemTransparent" BasedOn="{StaticResource ListBoxItemBaseStyle}" TargetType="ListBoxItem">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ListBoxItemNew" BasedOn="{StaticResource ListBoxItemTransparent}" TargetType="ListBoxItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="ListBoxItem">
|
||||
@@ -66,6 +70,11 @@
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
|
||||
<Style x:Key="ListBoxTransparent" BasedOn="{StaticResource ListBoxBaseStyle}" TargetType="ListBox">
|
||||
<Setter Property="Background" Value="Transparent"/>
|
||||
<Setter Property="ItemContainerStyle" Value="{StaticResource ListBoxItemTransparent}"/>
|
||||
</Style>
|
||||
|
||||
<ItemsPanelTemplate x:Key="FluidMoveBehaviorWrapPanelItemsPanelTemplate">
|
||||
<WrapPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||||
<interactivity:Interaction.Behaviors>
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
<controls:TransitioningContentControl>
|
||||
<UniformGrid Margin="32" Columns="3" Rows="2" Height="200">
|
||||
<Button Command="{Binding OpenWindowCmd}" CommandParameter="{x:Static data:MessageToken.CommonWindow}" Content="{x:Static langs:Lang.OpenCommonWindow}"/>
|
||||
<Button Command="{Binding OpenWindowCmd}" CommandParameter="{x:Static data:MessageToken.BlurWindow}" Content="{x:Static langs:Lang.OpenBlurWindow}"/>
|
||||
<Button Command="{Binding OpenWindowCmd}" CommandParameter="{x:Static data:MessageToken.CustomNonClientAreaWindow}" Content="{x:Static langs:Lang.OpenCustomNonClientAreaWindow}"/>
|
||||
<Button Click="ButtonMessage_OnClick" Content="{x:Static langs:Lang.OpenMessageWindow}"/>
|
||||
<Button Click="ButtonCustomContent_OnClick" Content="{x:Static langs:Lang.OpenCustomContentWindow}"/>
|
||||
|
||||
@@ -4,17 +4,18 @@
|
||||
x:Class="HandyControlDemo.UserControl.LeftMainContent"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:data="clr-namespace:HandyControlDemo.Data"
|
||||
Background="Transparent"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation">
|
||||
<TabControl SelectionChanged="TabControl_OnSelectionChanged" Style="{StaticResource TabControlInLine}">
|
||||
<TabControl SelectionChanged="TabControl_OnSelectionChanged" Style="{StaticResource TabControlInLine}" Background="Transparent" >
|
||||
<i:Interaction.Triggers>
|
||||
<i:EventTrigger EventName="SelectionChanged">
|
||||
<command:EventToCommand Command="{Binding SwitchDemoCmd}" PassEventArgsToCommand="True" />
|
||||
</i:EventTrigger>
|
||||
</i:Interaction.Triggers>
|
||||
<TabItem Header="{x:Static langs:Lang.Styles}">
|
||||
<ListBox BorderThickness="0" SelectionMode="Single">
|
||||
<TabItem Background="Transparent" Header="{x:Static langs:Lang.Styles}">
|
||||
<ListBox BorderThickness="0" SelectionMode="Single" Style="{StaticResource ListBoxTransparent}">
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.BrushDemoCtl}" Content="{x:Static langs:Lang.Brush}">
|
||||
<controls:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/Brush_16x.png"/>
|
||||
@@ -142,8 +143,8 @@
|
||||
</ListBoxItem>
|
||||
</ListBox>
|
||||
</TabItem>
|
||||
<TabItem Header="{x:Static langs:Lang.Controls}">
|
||||
<ListBox BorderThickness="0" SelectionMode="Single">
|
||||
<TabItem Background="Transparent" Header="{x:Static langs:Lang.Controls}">
|
||||
<ListBox BorderThickness="0" SelectionMode="Single" Style="{StaticResource ListBoxTransparent}">
|
||||
<ListBoxItem Tag="{x:Static data:MessageToken.NumericUpDownDemoCtl}" Content="{x:Static langs:Lang.NumericUpDown}">
|
||||
<controls:EdgeElement.LeftContent>
|
||||
<Image Source="../../Resources/Img/LeftMainContent/NumericListBox_16x.png"/>
|
||||
|
||||
@@ -0,0 +1,16 @@
|
||||
<controls:BlurWindow x:Class="HandyControlDemo.Window.BlurWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
||||
xmlns:controls="clr-namespace:HandyControl.Controls;assembly=HandyControl"
|
||||
xmlns:langs="clr-namespace:HandyControlDemo.Properties.Langs"
|
||||
mc:Ignorable="d"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Title="{x:Static langs:Lang.Title}"
|
||||
ShowTitle="True"
|
||||
Style="{StaticResource WindowBlur}"
|
||||
Height="450"
|
||||
Width="800"
|
||||
Icon="/HandyControlDemo;component/Resources/Img/icon.ico">
|
||||
</controls:BlurWindow>
|
||||
@@ -0,0 +1,10 @@
|
||||
namespace HandyControlDemo.Window
|
||||
{
|
||||
public partial class BlurWindow
|
||||
{
|
||||
public BlurWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
<controls:WindowBorderless x:Class="HandyControlDemo.Window.CommonWindow"
|
||||
<controls:Window x:Class="HandyControlDemo.Window.CommonWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
@@ -9,10 +9,10 @@
|
||||
ShowTitle="True"
|
||||
Background="{DynamicResource MainContentBackgroundBrush}"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Style="{StaticResource CustomWindowStyle}"
|
||||
Style="{StaticResource WindowWin10}"
|
||||
Title="{x:Static langs:Lang.Title}"
|
||||
Height="450"
|
||||
Width="800"
|
||||
Icon="/HandyControlDemo;component/Resources/Img/icon.ico">
|
||||
<Border Background="{DynamicResource MainContentForegroundDrawingBrush}"/>
|
||||
</controls:WindowBorderless>
|
||||
</controls:Window>
|
||||
@@ -1,4 +1,4 @@
|
||||
<controls:WindowBorderless x:Class="HandyControlDemo.Window.CustomNonClientAreaWindow"
|
||||
<controls:Window x:Class="HandyControlDemo.Window.CustomNonClientAreaWindow"
|
||||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||||
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
||||
@@ -13,11 +13,11 @@
|
||||
NonClientAreaHeight="69"
|
||||
Background="{DynamicResource MainContentBackgroundBrush}"
|
||||
WindowStartupLocation="CenterScreen"
|
||||
Style="{StaticResource CustomWindowStyle}"
|
||||
Style="{StaticResource WindowWin10}"
|
||||
Title="{x:Static langs:Lang.Title}"
|
||||
Height="450"
|
||||
Width="800">
|
||||
<controls:WindowBorderless.NonClientAreaContent>
|
||||
<controls:Window.NonClientAreaContent>
|
||||
<StackPanel Orientation="Horizontal" Height="69">
|
||||
<Path Data="{StaticResource LogoGeometry}" Width="40" Height="40" Stretch="Uniform" Fill="#F76B1C" Margin="20,0,0,0"></Path>
|
||||
<Button Style="{StaticResource ButtonCustom}" Margin="32,0,0,0">
|
||||
@@ -56,6 +56,6 @@
|
||||
</Border>
|
||||
</Button>
|
||||
</StackPanel>
|
||||
</controls:WindowBorderless.NonClientAreaContent>
|
||||
</controls:Window.NonClientAreaContent>
|
||||
<Border Background="{DynamicResource MainContentForegroundDrawingBrush}"/>
|
||||
</controls:WindowBorderless>
|
||||
</controls:Window>
|
||||
@@ -6,6 +6,10 @@
|
||||
|
||||
## Latest examples
|
||||
|
||||
### BlurWindow
|
||||
|
||||

|
||||
|
||||
### FlipClock
|
||||
|
||||

|
||||
|
||||
Binary file not shown.
|
After Width: | Height: | Size: 96 KiB |
Reference in new issue
Block a user