This commit is contained in:
GG Z
2025-07-31 20:12:01 +08:00
parent 6d96da6f90
commit 4f6cd2137c
292 changed files with 8276 additions and 10827 deletions

View File

@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net462</TargetFramework>
<OutputType>Library</OutputType>
<UseWPF>true</UseWPF>
<ImplicitUsings>true</ImplicitUsings>
<LangVersion>13.0</LangVersion>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.135" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data.DataSetExtensions" />
</ItemGroup>
<ItemGroup>
<Resource Include="antdwpf.png" />
</ItemGroup>
</Project>

View File

@@ -0,0 +1,21 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFramework>net462</TargetFramework>
<OutputType>Library</OutputType>
<UseWPF>true</UseWPF>
<ImplicitUsings>true</ImplicitUsings>
<LangVersion>13.0</LangVersion>
<ImportWindowsDesktopTargets>true</ImportWindowsDesktopTargets>
<GenerateAssemblyInfo>False</GenerateAssemblyInfo>
</PropertyGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.135" />
</ItemGroup>
<ItemGroup>
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Data.DataSetExtensions" />
</ItemGroup>
<ItemGroup>
<Resource Include="antdwpf.png" />
</ItemGroup>
</Project>

View File

@@ -1,6 +1,4 @@
using AntdWpf.Helpers;
using Microsoft.Xaml.Behaviors;
using Microsoft.Xaml.Behaviors;
using System.Linq;
using System.Reflection;
@@ -8,8 +6,9 @@ using System.Windows;
using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Documents;
using AntDesign.WPF.Helpers;
namespace AntdWpf.Behaviors
namespace AntDesign.WPF.Behaviors
{
[TemplatePart(Name = PART_TextBox, Type = typeof(TextBox))]

View File

@@ -2,7 +2,7 @@
using Microsoft.Xaml.Behaviors;
namespace AntdWpf.Behaviors
namespace AntDesign.WPF.Behaviors
{

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Behaviors
namespace AntDesign.WPF.Behaviors
{
using System.Windows;

View File

@@ -2,7 +2,7 @@
using System.Windows.Media.Animation;
using Microsoft.Xaml.Behaviors;
namespace AntdWpf.Behaviors
namespace AntDesign.WPF.Behaviors
{
/// <summary>
/// Provides the ability to animate when changing the Visibility property for an element.

View File

@@ -1,4 +1,4 @@
namespace AntdWpf
namespace AntDesign.WPF
{
using System;
using System.Windows.Media;

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Contracts
namespace AntDesign.WPF.Contracts
{
/// <summary>
/// Represents a spinable control. From https://github.com/charri/Font-Awesome-WPF/blob/master/src/WPF/FontAwesome.WPF/ISpinable.cs

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Contracts
namespace AntDesign.WPF.Contracts
{
using System.Windows;
using System.Windows.Controls.Primitives;

View File

@@ -3,7 +3,7 @@ using System.Windows.Controls;
using System.Windows.Controls.Primitives;
using System.Windows.Markup;
using System.Windows.Media;
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
/// <summary>
/// Alert component for feedback.

View File

@@ -5,7 +5,7 @@ using System.Windows.Markup;
using System.ComponentModel;
using System.Windows.Media;
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
/// <summary>
/// 图标控件

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
internal class AntIconDataFactory
{

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
public enum AntIconKey
{

View File

@@ -2,10 +2,9 @@
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
using AntDesign.WPF.Utils;
using AntdWpf.Utils;
namespace AntdWpf.Controls;
namespace AntDesign.WPF.Controls;
/// <summary>
/// Draws a border, background, or both around another element.

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
using System.Windows;
using System.Windows.Controls;

View File

@@ -1,7 +1,4 @@
using AntdWpf.Contracts;
using AntdWpf.Microsoft.Windows.Shell;
using AntdWpf.Win32;
using System;
using System;
using System.Collections;
using System.Reflection;
using System.Windows;
@@ -10,9 +7,12 @@ using System.Windows.Data;
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using System.Windows.Media;
using AntDesign.WPF.Contracts;
using AntDesign.WPF.Microsoft.Windows.Shell;
using AntDesign.WPF.Win32;
using Standard;
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Controls;
namespace AntDesign.WPF.Controls;
using System.Windows;
using System.Windows.Controls;

View File

@@ -4,7 +4,7 @@ using System.Windows.Media;
using WindowSize = System.Windows.Size;
using ContentControlBase = System.Windows.Controls.ContentControl;
namespace AntdWpf.Controls;
namespace AntDesign.WPF.Controls;
[TemplatePart(Name = PART_BadgeContainer, Type = typeof(FrameworkElement))]
[TemplatePart(Name = PART_Count, Type = typeof(ContentPresenter))]

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
public enum BorderStyle : byte
{

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
using System.Windows;
using System.Windows.Controls.Primitives;

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
using System;

View File

@@ -1,7 +1,7 @@
using System.Windows;
using System.Windows.Controls;
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
public class CodeBox : AntdContentControl
{

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
using System.Windows;
using System.Windows.Controls;

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
using System.Windows;
using System.Windows.Controls.Primitives;

View File

@@ -5,11 +5,10 @@ using System.Diagnostics;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Media;
using AntDesign.WPF.Contracts;
using AntDesign.WPF.Utils;
using AntdWpf.Contracts;
using AntdWpf.Utils;
namespace AntdWpf.Controls;
namespace AntDesign.WPF.Controls;
/// <summary>
/// 头像、警告提示语义矢量图形
/// </summary>

View File

@@ -7,7 +7,7 @@ using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
/// <summary>
/// Custom window class for a Material Design like styled window.
@@ -107,9 +107,9 @@ namespace AntdWpf.Controls
SetValue(TitleTemplateProperty, value);
}
}
private AntButton m_minimizeButton;
private AntButton m_maximizeRestoreButton;
private AntButton m_closeButton;
private AntdButton m_minimizeButton;
private AntdButton m_maximizeRestoreButton;
private AntdButton m_closeButton;
static MaterialWindow()
{
@@ -128,7 +128,7 @@ namespace AntdWpf.Controls
m_minimizeButton.Click -= MinimizeButtonClickHandler;
}
m_minimizeButton = GetTemplateChild(MinimizeButtonName) as AntButton;
m_minimizeButton = GetTemplateChild(MinimizeButtonName) as AntdButton;
if (m_minimizeButton != null)
{
@@ -140,7 +140,7 @@ namespace AntdWpf.Controls
m_maximizeRestoreButton.Click -= MaximizeRestoreButtonClickHandler;
}
m_maximizeRestoreButton = GetTemplateChild(MaximizeRestoreButtonName) as AntButton;
m_maximizeRestoreButton = GetTemplateChild(MaximizeRestoreButtonName) as AntdButton;
if (m_maximizeRestoreButton != null)
{
@@ -152,7 +152,7 @@ namespace AntdWpf.Controls
m_closeButton.Click -= CloseButtonClickHandler;
}
m_closeButton = GetTemplateChild(CloseButtonName) as AntButton;
m_closeButton = GetTemplateChild(CloseButtonName) as AntdButton;
if (m_closeButton != null)
{

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
using System;
using System.ComponentModel;

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
using System;
using System.Collections.Generic;

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
public enum Shapes : byte
{

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
public enum Sizes
{

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
using System.Windows;
using ContentControlBase = System.Windows.Controls.ContentControl;

View File

@@ -8,7 +8,7 @@ using System.Windows.Controls.Primitives;
using System.Windows.Media.Animation;
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
[TemplatePart(Name = PART_Dot, Type = typeof(FrameworkElement))]
public class Switch : ToggleButton

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
using System.Windows;

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
using System.Windows;
using ContentControlBase = System.Windows.Controls.ContentControl;

View File

@@ -1,8 +1,10 @@
namespace AntdWpf.Controls
using AntDesign.WPF.Contracts;
namespace AntDesign.WPF.Controls
{
using System.Windows.Input;
using AntdWpf.Contracts;
using WPF.Contracts;
using ThumbBase = System.Windows.Controls.Primitives.Thumb;

View File

@@ -1,4 +1,6 @@
namespace AntdWpf.Controls
using AntDesign.WPF.Contracts;
namespace AntDesign.WPF.Controls
{
using System;
using System.Diagnostics;
@@ -7,7 +9,7 @@
using System.Windows.Controls.Primitives;
using System.Windows.Input;
using AntdWpf.Contracts;
using WPF.Contracts;
public class ThumbContentControl : AntdContentControl, IThumb
{

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
using System.Windows;
using System.Windows.Automation.Peers;

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
using System.Windows.Controls.Primitives;

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
using System.Windows.Controls.Primitives;

View File

@@ -1,22 +1,17 @@
using AntdWpf.Controls;
using AntdWpf.Microsoft.Windows.Shell;
using AntdWpf.Win32;
using System.ComponentModel;
using System.Text;
using System.Windows.Threading;
using System.Windows.Controls.Primitives;
using AntDesign.WPF.Win32;
using SystemCommands = System.Windows.SystemCommands;
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
using System;
using System.ComponentModel;
using System.Text;
using System.Windows;
using System.Windows.Threading;
using System.Windows.Controls.Primitives;
using ContentControlBase = System.Windows.Controls.ContentControl;
using SystemCommands = SystemCommands;
[TemplatePart(Name = PART_Min, Type = typeof(ButtonBase))]
[TemplatePart(Name = PART_Max, Type = typeof(ButtonBase))]
[TemplatePart(Name = PART_Close, Type = typeof(ButtonBase))]
public class WindowButtons : ContentControlBase, INotifyPropertyChanged
public class WindowButtons : ContentControl, INotifyPropertyChanged
{
#region Events
@@ -47,9 +42,7 @@ namespace AntdWpf.Controls
private ButtonBase close;
#pragma warning disable 618
private SafeLibraryHandle user32;
#pragma warning restore 618
#endregion
@@ -145,19 +138,19 @@ namespace AntdWpf.Controls
(d as WindowButtons).ApplyStyle();
}
private AntdWpf.Controls.AntdWindow _parentWindow;
private AntdWindow parentWindow;
public AntdWpf.Controls.AntdWindow ParentWindow
public AntdWindow ParentWindow
{
get { return _parentWindow; }
get { return parentWindow; }
set
{
if (Equals(_parentWindow, value))
if (Equals(parentWindow, value))
{
return;
}
_parentWindow = value;
parentWindow = value;
RaisePropertyChanged("ParentWindow");
}
}
@@ -174,7 +167,8 @@ namespace AntdWpf.Controls
public WindowButtons()
{
Dispatcher.BeginInvoke(DispatcherPriority.Loaded,
new Action(() => {
new Action(() =>
{
if (string.IsNullOrWhiteSpace(Minimize))
{
SetCurrentValue(MinimizeProperty, GetCaption(900));
@@ -194,7 +188,6 @@ namespace AntdWpf.Controls
}));
}
#pragma warning disable 618
private string GetCaption(int id)
{
if (user32 == null)
@@ -206,7 +199,6 @@ namespace AntdWpf.Controls
UnsafeNativeMethods.LoadString(user32, (uint)id, sb, sb.Capacity);
return sb.ToString().Replace("&", "");
}
#pragma warning restore 618
#endregion
@@ -215,7 +207,7 @@ namespace AntdWpf.Controls
public override void OnApplyTemplate()
{
base.OnApplyTemplate();
close = Template.FindName(PART_Close, this) as ButtonBase;
if (close != null)
@@ -284,7 +276,6 @@ namespace AntdWpf.Controls
SystemCommands.MaximizeWindow(ParentWindow);
}
}
#pragma warning restore 618
private void OnClose(object sender, RoutedEventArgs e)
{

View File

@@ -2,7 +2,7 @@
using System.Windows;
using System.Windows.Controls;
namespace AntdWpf.Controls
namespace AntDesign.WPF.Controls
{
public class WindowCommands : ItemsControl, INotifyPropertyChanged
{

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Converters;
namespace AntDesign.WPF.Converters;
using System;
using System.Globalization;

View File

@@ -6,7 +6,7 @@ using System.Windows.Markup;
//https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/blob/master/src/MaterialDesignThemes.Wpf/Converters/CircularProgressBar/ArcEndPointConverter.cs
namespace AntdWpf.Converters
namespace AntDesign.WPF.Converters
{
public class ArcEndPointConverter : MarkupExtension, IMultiValueConverter
{

View File

@@ -7,7 +7,7 @@ using System.Windows.Markup;
//https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/blob/master/src/MaterialDesignThemes.Wpf/Converters/CircularProgressBar/ArcSizeConverter.cs
namespace AntdWpf.Converters
namespace AntDesign.WPF.Converters
{
public class ArcSizeConverter : MarkupExtension, IValueConverter
{

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Converters
namespace AntDesign.WPF.Converters
{
using System;
using System.Globalization;

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Converters
namespace AntDesign.WPF.Converters
{
using System;
using System.Globalization;

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Converters
namespace AntDesign.WPF.Converters
{
using System;
using System.Globalization;

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Converters;
namespace AntDesign.WPF.Converters;
using System;
using System.Globalization;

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Converters;
namespace AntDesign.WPF.Converters;
using System;
using System.Globalization;

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Converters
namespace AntDesign.WPF.Converters
{
using System;
using System.Globalization;

View File

@@ -8,7 +8,7 @@ using System.Windows.Data;
using System.Windows.Markup;
using System.Windows;
namespace AntdWpf.Converters
namespace AntDesign.WPF.Converters
{
public class DoubleToThicknessMultiConverter : MarkupExtension, IMultiValueConverter
{

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Converters;
namespace AntDesign.WPF.Converters;
using System;
using System.Globalization;

View File

@@ -6,7 +6,7 @@ using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Markup;
namespace AntdWpf.Converters;
namespace AntDesign.WPF.Converters;
/// <summary>
/// 构造单例的Converter的markup

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Converters
namespace AntDesign.WPF.Converters
{
using System;
using System.Globalization;

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Converters
namespace AntDesign.WPF.Converters
{
using System;
using System.Globalization;

View File

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Markup;
namespace AntdWpf.Converters
namespace AntDesign.WPF.Converters
{
public class LessThanConverter : MarkupExtension, IValueConverter
{

View File

@@ -1,9 +1,7 @@
using System.Collections.Generic;
using System.Linq;

//https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/blob/master/src/MaterialDesignThemes.Wpf/Converters/CircularProgressBar/LocalEx.cs
namespace AntdWpf.Converters
namespace AntDesign.WPF.Converters
{
internal static class LocalEx
{

View File

@@ -7,7 +7,7 @@ using System.Threading.Tasks;
using System.Windows.Data;
using System.Windows.Markup;
namespace AntdWpf.Converters
namespace AntDesign.WPF.Converters
{
public sealed class MathConverter : MarkupExtension, IValueConverter
{

View File

@@ -4,7 +4,7 @@ using System.Linq;
using System.Windows.Data;
using System.Windows.Markup;
namespace AntdWpf.Converters;
namespace AntDesign.WPF.Converters;
public sealed class MathMultiConverter : MarkupExtension, IMultiValueConverter
{

View File

@@ -1,7 +1,7 @@
using System;
using System.Linq;
namespace AntdWpf.Converters;
namespace AntDesign.WPF.Converters;
public enum MathOperation
{

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Converters
namespace AntDesign.WPF.Converters
{
using System;
using System.Globalization;

View File

@@ -4,7 +4,7 @@ using System.Windows;
using System.Windows.Data;
using System.Windows.Markup;
namespace AntdWpf.Converters
namespace AntDesign.WPF.Converters
{
public class StartPointConverter : MarkupExtension, IValueConverter
{

View File

@@ -7,7 +7,7 @@ using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Media;
namespace AntdWpf.Converters
namespace AntDesign.WPF.Converters
{
public class StringToCodeConverter : IValueConverter
{

View File

@@ -7,7 +7,7 @@ using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Media;
namespace AntdWpf.Converters
namespace AntDesign.WPF.Converters
{
public class StringToMarkDownConverter : IValueConverter
{

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Converters
namespace AntDesign.WPF.Converters
{
using System;
using System.Globalization;

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Converters;
namespace AntDesign.WPF.Converters;
using System;
using System.Globalization;

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Converters
namespace AntDesign.WPF.Converters
{
using System;
using System.Globalization;

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Converters
namespace AntDesign.WPF.Converters
{
using System;
using System.Globalization;

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Converters;
namespace AntDesign.WPF.Converters;
using System;
using System.Globalization;

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Converters
namespace AntDesign.WPF.Converters
{
using System;
using System.Globalization;

View File

@@ -1,10 +1,12 @@
namespace AntdWpf.Helpers
using AntDesign.WPF.Controls;
namespace AntDesign.WPF.Helpers
{
using System.ComponentModel;
using System.Windows;
using System.Windows.Media;
using AntdWpf.Controls;
using WPF.Controls;
/// <summary>
/// A helper class that provides various controls.

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Helpers
namespace AntDesign.WPF.Helpers
{
using System;
using System.Linq;

View File

@@ -7,7 +7,7 @@ using System.Windows.Controls;
using System.Windows.Media.Animation;
using System.Windows;
namespace AntdWpf.Helpers
namespace AntDesign.WPF.Helpers
{
public class ProgressAssist
{

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Helpers
namespace AntDesign.WPF.Helpers
{
using System.Collections.Generic;
using System.Windows;

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Microsoft.Windows.Shell.Standard
namespace AntDesign.WPF.Microsoft.Windows.Shell.Standard
{
using System.Diagnostics.CodeAnalysis;

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Microsoft.Windows.Shell.Standard
namespace AntDesign.WPF.Microsoft.Windows.Shell.Standard
{
using System.Diagnostics.CodeAnalysis;

View File

@@ -1,5 +1,5 @@
#pragma warning disable 1591, 618
namespace AntdWpf.Microsoft.Windows.Shell.Standard
namespace AntDesign.WPF.Microsoft.Windows.Shell.Standard
{
using System;
using System.Diagnostics.CodeAnalysis;

View File

@@ -1,6 +1,6 @@
using Standard;
#pragma warning disable 1591, 618
namespace AntdWpf.Microsoft.Windows.Shell.Standard
namespace AntDesign.WPF.Microsoft.Windows.Shell.Standard
{
using System;
using System.ComponentModel;

View File

@@ -1,6 +1,6 @@
using Standard;
#pragma warning disable 1591, 618
namespace AntdWpf.Microsoft.Windows.Shell.Standard
namespace AntDesign.WPF.Microsoft.Windows.Shell.Standard
{
using System;
using System.Collections.Generic;

View File

@@ -1,5 +1,5 @@
#pragma warning disable 1591, 618
using AntdWpf.Microsoft.Windows.Shell.Standard;
using AntDesign.WPF.Microsoft.Windows.Shell.Standard;
namespace Standard
{

View File

@@ -1,6 +1,6 @@
using Standard;
#pragma warning disable 1591, 618
namespace AntdWpf.Microsoft.Windows.Shell.Standard
namespace AntDesign.WPF.Microsoft.Windows.Shell.Standard
{
using System;
using System.Runtime.InteropServices;
@@ -660,7 +660,7 @@ namespace AntdWpf.Microsoft.Windows.Shell.Standard
[
ComImport,
InterfaceTypeAttribute(ComInterfaceType.InterfaceIsIUnknown),
InterfaceType(ComInterfaceType.InterfaceIsIUnknown),
Guid(IID.ShellLink),
]
internal interface IShellLinkW

View File

@@ -5,7 +5,7 @@
// Because the classes here are internal, it's likely this file
// might be included in multiple assemblies.
#pragma warning disable 1591, 618
namespace AntdWpf.Microsoft.Windows.Shell.Standard
namespace AntDesign.WPF.Microsoft.Windows.Shell.Standard
{
using System;
using System.Collections.Generic;

View File

@@ -4,7 +4,7 @@
// 它们与任何库函数无关。
// 因为这里的类是内部类,所以这个文件
// 可能包含在多个程序集中。
namespace AntdWpf.Microsoft.Windows.Shell.Standard
namespace AntDesign.WPF.Microsoft.Windows.Shell.Standard
{
using System;
using System.Diagnostics;

View File

@@ -1,4 +1,4 @@
namespace AntdWpf.Microsoft.Windows.Shell
namespace AntDesign.WPF.Microsoft.Windows.Shell
{
using System;
using System.Windows;

View File

@@ -2,7 +2,7 @@
Copyright Microsoft Corporation. All Rights Reserved.
\**************************************************************************/
#pragma warning disable 1591, 618
using AntdWpf.Microsoft.Windows.Shell.Standard;
using AntDesign.WPF.Microsoft.Windows.Shell.Standard;
namespace Microsoft.Windows.Shell
{

View File

@@ -1,11 +1,10 @@
using AntdWpf.Microsoft.Windows.Shell.Standard;
using AntDesign.WPF.Microsoft.Windows.Shell.Standard;
using Microsoft.Windows.Shell;
/**************************************************************************\
Copyright Microsoft Corporation. All Rights Reserved.
\**************************************************************************/
#pragma warning disable 1591, 618
namespace AntdWpf.Microsoft.Windows.Shell
namespace AntDesign.WPF.Microsoft.Windows.Shell
{
using System;
using System.Collections.Generic;

View File

@@ -1,5 +1,5 @@
using AntdWpf.Microsoft.Windows.Shell;
using AntdWpf.Microsoft.Windows.Shell.Standard;
using AntDesign.WPF.Microsoft.Windows.Shell;
using AntDesign.WPF.Microsoft.Windows.Shell.Standard;
/**************************************************************************\
Copyright Microsoft Corporation. All Rights Reserved.
\**************************************************************************/
@@ -901,7 +901,7 @@ namespace Microsoft.Windows.Shell
if (HT.CAPTION == (HT)(Environment.Is64BitProcess ? wParam.ToInt64() : wParam.ToInt32()))
{
//SystemCommands.ShowSystemMenuPhysicalCoordinates(_window, new Point(Utility.GET_X_LPARAM(lParam), Utility.GET_Y_LPARAM(lParam)));
AntdWpf.Microsoft.Windows.Shell.SystemCommands.ShowSystemMenuPhysicalCoordinates(_window, Utility.GetPoint(lParam));
AntDesign.WPF.Microsoft.Windows.Shell.SystemCommands.ShowSystemMenuPhysicalCoordinates(_window, Utility.GetPoint(lParam));
}
handled = false;
return IntPtr.Zero;

View File

@@ -8,11 +8,11 @@ using System.Windows.Markup;
// 有关程序集的一般信息由以下
// 控制。更改这些特性值可修改
// 与程序集关联的信息。
[assembly: AssemblyTitle("AntdWpf")]
[assembly: AssemblyTitle("AntDesign.WPF")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("AntdWpf")]
[assembly: AssemblyProduct("AntDesign.WPF")]
[assembly: AssemblyCopyright("Copyright © 2025")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
@@ -52,7 +52,7 @@ using System.Windows.Markup;
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]
[assembly: XmlnsPrefix("https://github.com/ShrlAlgo/AntdWpf", "antd")]
[assembly: XmlnsDefinition("https://github.com/ShrlAlgo/AntdWpf", "AntdWpf.Controls")]
//[assembly: XmlnsDefinition("https://github.com/ShrlAlgo/AntdWpf", "AntdWpf.Converters")]
[assembly: XmlnsDefinition("https://github.com/ShrlAlgo/AntdWpf", "AntdWpf.Helpers")]
[assembly: XmlnsPrefix("https://github.com/ShrlAlgo/AntDesign.WPF", "ant")]
[assembly: XmlnsDefinition("https://github.com/ShrlAlgo/AntDesign.WPF", "AntDesign.WPF.Controls")]
//[assembly: XmlnsDefinition("https://github.com/ShrlAlgo/AntDesign.WPF", "AntDesign.WPF.Converters")]
[assembly: XmlnsDefinition("https://github.com/ShrlAlgo/AntDesign.WPF", "AntDesign.WPF.Helpers")]

View File

@@ -8,7 +8,7 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace AntdWpf.Properties {
namespace AntDesign.WPF.Properties {
/// <summary>
@@ -38,7 +38,7 @@ namespace AntdWpf.Properties {
internal static global::System.Resources.ResourceManager ResourceManager {
get {
if ((resourceMan == null)) {
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AntdWpf.Properties.Resources", typeof(Resources).Assembly);
global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("AntDesign.WPF.Properties.Resources", typeof(Resources).Assembly);
resourceMan = temp;
}
return resourceMan;

View File

@@ -8,7 +8,7 @@
// </auto-generated>
//------------------------------------------------------------------------------
namespace AntdWpf.Properties
namespace AntDesign.WPF.Properties
{

View File

@@ -1,16 +1,17 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:AntdWpf.Controls"
xmlns:Behaviors="clr-namespace:AntdWpf.Behaviors"
xmlns:helpers="clr-namespace:AntdWpf.Helpers">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:Behaviors="clr-namespace:AntDesign.WPF.Behaviors"
xmlns:controls="clr-namespace:AntDesign.WPF.Controls"
xmlns:helpers="clr-namespace:AntDesign.WPF.Helpers"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Styles/Animations.xaml" />
<ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Styles/Control.xaml" />
<ResourceDictionary Source="pack://application:,,,/AntDesign.WPF;component/Styles/Animations.xaml" />
<ResourceDictionary Source="pack://application:,,,/AntDesign.WPF;component/Styles/Control.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style BasedOn="{StaticResource Ant.Control}" TargetType="{x:Type controls:Alert}">
<Setter Property="Padding" Value="15 8" />
<Setter Property="Padding" Value="15,8" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="VerticalContentAlignment" Value="Center" />
@@ -21,10 +22,8 @@
<Setter Property="BorderThickness" Value="{DynamicResource BorderThicknessBase}" />
<Setter Property="helpers:AntdControl.BorderStyle" Value="{DynamicResource BorderStyleBase}" />
<Setter Property="helpers:AntdControl.CornerRadius" Value="{DynamicResource BorderRadiusBase}" />
<Setter Property="Background" Value="{Binding IconBrush, Mode=OneWay, RelativeSource={RelativeSource Self},
Converter={StaticResource ColorPaletteConverter}, ConverterParameter=1}" />
<Setter Property="BorderBrush" Value="{Binding IconBrush, Mode=OneWay, RelativeSource={RelativeSource Self},
Converter={StaticResource ColorPaletteConverter}, ConverterParameter=3}" />
<Setter Property="Background" Value="{Binding IconBrush, Mode=OneWay, RelativeSource={RelativeSource Self}, Converter={StaticResource ColorPaletteConverter}, ConverterParameter=1}" />
<Setter Property="BorderBrush" Value="{Binding IconBrush, Mode=OneWay, RelativeSource={RelativeSource Self}, Converter={StaticResource ColorPaletteConverter}, ConverterParameter=3}" />
<Setter Property="RenderTransform">
<Setter.Value>
<ScaleTransform />
@@ -36,16 +35,18 @@
<Behaviors:VisibilityBehavior>
<Behaviors:VisibilityBehavior.Leave>
<Storyboard FillBehavior="Stop">
<DoubleAnimation Storyboard.TargetProperty="Opacity"
EasingFunction="{StaticResource EaseInOutCirc}"
Duration="0:0:0.3"
From="1"
To="0" />
<DoubleAnimation Storyboard.TargetProperty="RenderTransform.ScaleY"
EasingFunction="{StaticResource EaseInOutCirc}"
Duration="0:0:0.3"
From="1"
To="0" />
<DoubleAnimation
Duration="0:0:0.3"
EasingFunction="{StaticResource EaseInOutCirc}"
From="1"
Storyboard.TargetProperty="Opacity"
To="0" />
<DoubleAnimation
Duration="0:0:0.3"
EasingFunction="{StaticResource EaseInOutCirc}"
From="1"
Storyboard.TargetProperty="RenderTransform.ScaleY"
To="0" />
</Storyboard>
</Behaviors:VisibilityBehavior.Leave>
</Behaviors:VisibilityBehavior>
@@ -55,18 +56,19 @@
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:Alert}">
<controls:AntdBorder UseLayoutRounding="True"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
BorderStyle="{TemplateBinding helpers:AntdControl.BorderStyle}"
CornerRadius="{TemplateBinding helpers:AntdControl.CornerRadius}">
<controls:AntdBorder
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderStyle="{TemplateBinding helpers:AntdControl.BorderStyle}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding helpers:AntdControl.CornerRadius}"
Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
UseLayoutRounding="True">
<Grid>
<Grid.Resources>
<!-- TODO Does it have other uses? -->
<Style x:Key="Ant.AlertCloseButton" TargetType="{x:Type Button}">
<!-- TODO Does it have other uses? -->
<Style TargetType="{x:Type Button}" x:Key="Ant.AlertCloseButton">
<Setter Property="Padding" Value="0" />
<Setter Property="Foreground" Value="{DynamicResource LinkBrush}" />
<Setter Property="FontSize" Value="{DynamicResource FontSizeSmall}" />
@@ -81,8 +83,7 @@
<Trigger Property="IsMouseOver" Value="True">
<Setter Property="Opacity" Value="0.85" />
</Trigger>
<DataTrigger Binding="{Binding IsPressed, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type Button}}}"
Value="True">
<DataTrigger Binding="{Binding IsPressed, Mode=OneWay, RelativeSource={RelativeSource AncestorType={x:Type Button}}}" Value="True">
<Setter Property="Opacity" Value="1" />
</DataTrigger>
</Style.Triggers>
@@ -103,62 +104,62 @@
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<!-- Icon -->
<!-- Icon -->
<ColumnDefinition Width="Auto" />
<!-- Text -->
<!-- Text -->
<ColumnDefinition Width="*" />
<!-- Close Button -->
<!-- Close Button -->
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<!-- Message -->
<!-- Message -->
<RowDefinition />
<!-- Description -->
<!-- Description -->
<RowDefinition />
</Grid.RowDefinitions>
<!-- Icon -->
<controls:Icon x:Name="Icon"
Theme="Filled"
Margin="0 0 8 0"
Type="{TemplateBinding Icon}"
Foreground="{TemplateBinding IconBrush}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Visibility="{Binding ShowIcon, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent},
Converter={StaticResource BooleanToVisibilityConverter}}"/>
<!-- Message -->
<ContentPresenter x:Name="Message"
Grid.Column="1"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Content="{Binding Message, RelativeSource={RelativeSource TemplatedParent},
Converter={StaticResource StringToTextBlockConverter}}" />
<!-- Description -->
<ContentPresenter x:Name="Description"
Grid.Row="1"
Grid.Column="1"
Grid.ColumnSpan="2"
Visibility="Collapsed"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Content="{Binding Description, RelativeSource={RelativeSource TemplatedParent},
Converter={StaticResource StringToTextBlockConverter}}" />
<!-- Close Button -->
<Button x:Name="PART_Close"
Grid.Column="2"
Style="{StaticResource Ant.AlertCloseButton}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
<!-- Icon -->
<controls:Icon
Foreground="{TemplateBinding IconBrush}"
Margin="0,0,8,0"
Theme="Filled"
Type="{TemplateBinding Icon}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
Visibility="{Binding ShowIcon, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource BooleanToVisibilityConverter}}"
x:Name="Icon" />
<!-- Message -->
<ContentPresenter
Content="{Binding Message, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToTextBlockConverter}}"
Grid.Column="1"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="Message" />
<!-- Description -->
<ContentPresenter
Content="{Binding Description, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource StringToTextBlockConverter}}"
Grid.Column="1"
Grid.ColumnSpan="2"
Grid.Row="1"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Visibility="Collapsed"
x:Name="Description" />
<!-- Close Button -->
<Button
Grid.Column="2"
Style="{StaticResource Ant.AlertCloseButton}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="PART_Close" />
</Grid>
</controls:AntdBorder>
<ControlTemplate.Triggers>
<!-- With Description -->
<DataTrigger Binding="{Binding Description, Mode=OneWay, RelativeSource={RelativeSource Self},
Converter={StaticResource IsNullConverter}}" Value="False">
<Setter TargetName="Icon" Property="FontSize" Value="24" />
<Setter TargetName="Icon" Property="Theme" Value="Outlined" />
<Setter TargetName="Message" Property="Margin" Value="0 0 0 4" />
<Setter TargetName="Description" Property="Visibility" Value="Visible" />
<Setter TargetName="PART_Close" Property="FontSize" Value="{DynamicResource FontSizeBase}" />
<Setter TargetName="Message" Property="TextElement.FontSize" Value="{DynamicResource FontSizeLarge}" />
<Setter TargetName="Message" Property="TextElement.Foreground" Value="{DynamicResource HeadingBrush}" />
<!-- With Description -->
<DataTrigger Binding="{Binding Description, Mode=OneWay, RelativeSource={RelativeSource Self}, Converter={StaticResource IsNullConverter}}" Value="False">
<Setter Property="FontSize" TargetName="Icon" Value="24" />
<Setter Property="Theme" TargetName="Icon" Value="Outlined" />
<Setter Property="Margin" TargetName="Message" Value="0,0,0,4" />
<Setter Property="Visibility" TargetName="Description" Value="Visible" />
<Setter Property="FontSize" TargetName="PART_Close" Value="{DynamicResource FontSizeBase}" />
<Setter Property="TextElement.FontSize" TargetName="Message" Value="{DynamicResource FontSizeLarge}" />
<Setter Property="TextElement.Foreground" TargetName="Message" Value="{DynamicResource HeadingBrush}" />
</DataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
@@ -186,5 +187,5 @@
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>

View File

@@ -1,20 +1,22 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:AntdWpf.Controls">
<Style TargetType="{x:Type controls:AntIcon}" >
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:controls="clr-namespace:AntDesign.WPF.Controls"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<Style TargetType="{x:Type controls:AntIcon}">
<Setter Property="FlowDirection" Value="LeftToRight" />
<Setter Property="Height" Value="16" />
<Setter Property="Foreground" Value="{StaticResource IconBrush}"/>
<Setter Property="Foreground" Value="{StaticResource IconBrush}" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="IsTabStop" Value="False" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:AntIcon}">
<Border Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<Viewbox FlowDirection="{TemplateBinding FlowDirection}">
<Canvas Width="24" Height="24">
<Canvas Height="24" Width="24">
<Path Data="{Binding Data, RelativeSource={RelativeSource TemplatedParent}}" Fill="{TemplateBinding Foreground}" />
</Canvas>
</Viewbox>

View File

@@ -0,0 +1,201 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:AntdShell="clr-namespace:AntDesign.WPF.Microsoft.Windows.Shell"
xmlns:Shell="clr-namespace:Microsoft.Windows.Shell"
xmlns:controls="clr-namespace:AntDesign.WPF.Controls"
xmlns:helpers="clr-namespace:AntDesign.WPF.Helpers"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/AntDesign.WPF;component/Styles/Converters.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style TargetType="{x:Type Thumb}" x:Key="Ant.TitleBarThumb">
<Setter Property="Background" Value="Transparent" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate>
<Grid Background="{TemplateBinding Background}" />
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type controls:AntdWindow}">
<Setter Property="WindowStyle" Value="None" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
<Setter Property="Icon" Value="{StaticResource AntDesignDrawingImage}" />
<!--<Setter Property="FontFamily" Value="{DynamicResource FontFamily}" />-->
<Setter Property="FontSize" Value="{DynamicResource FontSizeBase}" />
<!--<Setter Property="Template" Value="{StaticResource Ant.WindowTemplate}" />-->
<Setter Property="Background" Value="{DynamicResource BodyBackground}" />
<Setter Property="TitleBarForeground" Value="{DynamicResource WindowTilteBarForeground}" />
<Setter Property="TitleBarBackground" Value="{DynamicResource WindowTilteBarBackground}" />
<Setter Property="IconTemplate">
<Setter.Value>
<DataTemplate>
<Image
Source="{TemplateBinding Content}"
Stretch="None"
VerticalAlignment="Center" />
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="TitleTemplate">
<Setter.Value>
<DataTemplate>
<TextBlock
FontSize="{DynamicResource FontSizeSmall}"
Margin="8,0"
Text="{TemplateBinding Content}"
TextTrimming="CharacterEllipsis"
VerticalAlignment="Center" />
</DataTemplate>
</Setter.Value>
</Setter>
<Setter Property="AntdShell:WindowChrome.WindowChrome">
<Setter.Value>
<AntdShell:WindowChrome
CaptionHeight="0"
CornerRadius="0"
GlassFrameThickness="0 0 0 0.1"
UseAeroCaptionButtons="False" />
</Setter.Value>
</Setter>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:AntdWindow}">
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding helpers:AntdControl.CornerRadius}"
LayoutTransform="{TemplateBinding LayoutTransform}"
Margin="{Binding WindowNonClientFrameThickness, Source={x:Static Shell:SystemParameters2.Current}}"
RenderTransform="{TemplateBinding RenderTransform}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
UseLayoutRounding="True">
<AdornerDecorator>
<Grid UseLayoutRounding="False" x:Name="LayoutRoot">
<Grid.ColumnDefinitions>
<!-- icon -->
<ColumnDefinition Width="Auto" />
<!-- left window commands -->
<ColumnDefinition Width="Auto" />
<!-- title -->
<ColumnDefinition Width="*" />
<!-- right window commands -->
<ColumnDefinition Width="Auto" />
<!-- min,max,close buttons -->
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<!-- title bar -->
<Rectangle
Fill="{TemplateBinding TitleBarBackground}"
Focusable="False"
Grid.ColumnSpan="5"
Height="{TemplateBinding TitleBarHeight}"
StrokeThickness="0"
x:Name="PART_TitleBar" />
<!--
Note:
thumb 元素必须放在标题栏背景之后,
否则会影响双击标题栏窗口以最大化
-->
<controls:Thumb
Grid.ColumnSpan="5"
Style="{StaticResource Ant.TitleBarThumb}"
x:Name="PART_TitleBarThumb" />
<!-- icon -->
<ContentPresenter
Content="{TemplateBinding Icon}"
ContentTemplate="{TemplateBinding IconTemplate}"
Focusable="False"
Height="{TemplateBinding TitleBarHeight}"
VerticalAlignment="Top"
x:Name="PART_Icon" />
<!-- 左侧窗口命令 -->
<ContentPresenter
Content="{TemplateBinding LeftWindowCommands}"
Focusable="False"
Grid.Column="1"
Height="{TemplateBinding TitleBarHeight}"
VerticalAlignment="Top"
x:Name="PART_LeftWindowCommands" />
<!-- title -->
<controls:ThumbContentControl
Content="{TemplateBinding Title}"
ContentCharacterCasing="{TemplateBinding TitleCharacterCasing}"
ContentTemplate="{TemplateBinding TitleTemplate}"
Focusable="False"
Foreground="{TemplateBinding TitleBarForeground}"
Grid.Column="2"
Height="{TemplateBinding TitleBarHeight}"
HorizontalAlignment="{TemplateBinding TitleAlignment}"
x:Name="PART_Title" />
<!-- 右侧窗口命令 -->
<ContentPresenter
Content="{TemplateBinding RightWindowCommands}"
Focusable="False"
Grid.Column="3"
Height="{TemplateBinding TitleBarHeight}"
VerticalAlignment="Top"
x:Name="PART_RightWindowCommands" />
<!-- Window 按钮命令 -->
<ContentPresenter
Content="{TemplateBinding WindowButtons}"
Focusable="False"
Grid.Column="4"
Height="{TemplateBinding TitleBarHeight}"
VerticalAlignment="Top"
x:Name="PART_WindowButtons" />
<!-- 主窗口内容 -->
<ContentPresenter
Focusable="False"
Grid.ColumnSpan="5"
Grid.Row="1" />
<!-- ResizeGrip -->
<ResizeGrip
Grid.ColumnSpan="5"
Grid.Row="1"
HorizontalAlignment="Right"
IsTabStop="False"
UseLayoutRounding="True"
VerticalAlignment="Bottom"
Visibility="Collapsed"
x:Name="WindowResizeGrip" />
</Grid>
</AdornerDecorator>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="UseNoneWindowStyle" Value="True">
<Setter Property="Grid.RowSpan" TargetName="PART_TitleBarThumb" Value="2" />
</Trigger>
<Trigger Property="Icon" Value="{x:Null}">
<Setter Property="Visibility" TargetName="PART_Icon" Value="Collapsed" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="IgnoreTaskbar" Value="False" />
<Condition Property="WindowState" Value="Maximized" />
</MultiTrigger.Conditions>
<Setter Property="Margin" TargetName="LayoutRoot" Value="7" />
</MultiTrigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="ResizeMode" Value="CanResizeWithGrip" />
<Condition Property="WindowState" Value="Normal" />
</MultiTrigger.Conditions>
<Setter Property="Visibility" TargetName="WindowResizeGrip" Value="Visible" />
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</ResourceDictionary>

View File

@@ -1,10 +1,11 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:AntdWpf.Controls"
xmlns:helpers="clr-namespace:AntdWpf.Helpers">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:controls="clr-namespace:AntDesign.WPF.Controls"
xmlns:helpers="clr-namespace:AntDesign.WPF.Helpers"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Styles/Converters.xaml" />
<ResourceDictionary Source="pack://application:,,,/AntDesign.WPF;component/Styles/Converters.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style TargetType="{x:Type controls:Avatar}">
@@ -20,20 +21,21 @@
<Setter Property="Foreground" Value="{DynamicResource AvatarForeground}" />
<Setter Property="Background" Value="{DynamicResource AvatarBackground}" />
<Setter Property="Height" Value="{Binding Width, Mode=OneWay, RelativeSource={RelativeSource Self}}" />
<Setter Property="helpers:AntdControl.CornerRadius" Value="{Binding Width, Mode=OneWay, RelativeSource={RelativeSource Self},
Converter={StaticResource DoubleToCornerRadiusConverter}, ConverterParameter=2}" />
<Setter Property="helpers:AntdControl.CornerRadius" Value="{Binding Width, Mode=OneWay, RelativeSource={RelativeSource Self}, Converter={StaticResource DoubleToCornerRadiusConverter}, ConverterParameter=2}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:Avatar}">
<Border Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
CornerRadius="{TemplateBinding helpers:AntdControl.CornerRadius}">
<ContentPresenter x:Name="PART_Content"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" />
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding helpers:AntdControl.CornerRadius}"
Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}">
<ContentPresenter
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="PART_Content" />
</Border>
</ControlTemplate>
</Setter.Value>
@@ -42,7 +44,7 @@
<Trigger Property="Shape" Value="Square">
<Setter Property="helpers:AntdControl.CornerRadius" Value="{DynamicResource AvatarBorderRadius}" />
</Trigger>
<!-- Sizes -->
<!-- Sizes -->
<Trigger Property="Size" Value="Small">
<Setter Property="Width" Value="{DynamicResource AvatarSizeSmall}" />
<Setter Property="FontSize" Value="{DynamicResource AvatarFontSizeSmall}" />
@@ -51,7 +53,7 @@
<Setter Property="Width" Value="{DynamicResource AvatarSizeLarge}" />
<Setter Property="FontSize" Value="{DynamicResource AvatarFontSizeLarge}" />
</Trigger>
<!-- without icon -->
<!-- without icon -->
<Trigger Property="Icon" Value="{x:Null}">
<Setter Property="FontSize" Value="{DynamicResource FontSizeBase}" />
</Trigger>
@@ -60,5 +62,5 @@
</Trigger>
</Style.Triggers>
</Style>
</ResourceDictionary>

View File

@@ -0,0 +1,343 @@
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:controls="clr-namespace:AntDesign.WPF.Controls"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/AntDesign.WPF;component/Styles/Converters.xaml" />
<ResourceDictionary Source="pack://application:,,,/AntDesign.WPF;component/Styles/Animations.xaml" />
</ResourceDictionary.MergedDictionaries>
<Storyboard x:Key="Ant.BadgeEffectStoryboard">
<DoubleAnimation
Duration="0:0:1.2"
EasingFunction="{StaticResource EaseInOut}"
From="0.5"
RepeatBehavior="Forever"
Storyboard.TargetName="Effect"
Storyboard.TargetProperty="(UIElement.Opacity)"
To="0" />
<DoubleAnimation
Duration="0:0:1.2"
EasingFunction="{StaticResource EaseInOut}"
From="0.8"
RepeatBehavior="Forever"
Storyboard.TargetName="EffectTransform"
Storyboard.TargetProperty="ScaleX"
To="2.4" />
<DoubleAnimation
Duration="0:0:1.2"
EasingFunction="{StaticResource EaseInOut}"
From="0.8"
RepeatBehavior="Forever"
Storyboard.TargetName="EffectTransform"
Storyboard.TargetProperty="ScaleY"
To="2.4" />
</Storyboard>
<ControlTemplate TargetType="{x:Type controls:Badge}" x:Key="Ant.BadgeTemplate">
<Grid>
<!-- Effect -->
<!--<Ellipse x:Name="Effect"
Opacity="0"
StrokeThickness="1"
RenderTransformOrigin="0.5,0.5"
Width="{TemplateBinding BadgeHeight}"
Height="{TemplateBinding BadgeHeight}"
Stroke="{DynamicResource ProcessingBrush}">
<Ellipse.RenderTransform>
<ScaleTransform x:Name="EffectTransform" />
</Ellipse.RenderTransform>
</Ellipse>-->
<!-- Content -->
<Border
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}">
<ContentPresenter
Content="{TemplateBinding Content}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Border>
<!-- Count -->
<Border
Background="{TemplateBinding BadgeBackground}"
CornerRadius="{Binding Height, RelativeSource={RelativeSource Self}, Converter={StaticResource DoubleToCornerRadiusConverter}, ConverterParameter=2}"
Height="{TemplateBinding BadgeHeight}"
HorizontalAlignment="Right"
MinWidth="{TemplateBinding Height}"
Padding="6,0"
TextElement.FontSize="{DynamicResource BadgeFontSize}"
TextElement.FontWeight="{DynamicResource BadgeFontWeight}"
TextElement.Foreground="{TemplateBinding BadgeForeground}"
VerticalAlignment="Top"
x:Name="PART_BadgeContainer">
<Border.RenderTransform>
<TranslateTransform X="-10" Y="-10" />
</Border.RenderTransform>
<ContentPresenter
HorizontalAlignment="Center"
VerticalAlignment="Center"
x:Name="PART_Count" />
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="Dot" Value="True">
<Setter Property="Visibility" TargetName="PART_Count" Value="Collapsed" />
<Setter Property="Padding" TargetName="PART_BadgeContainer" Value="0" />
<Setter Property="MinWidth" TargetName="PART_BadgeContainer" Value="0" />
<Setter Property="Width" TargetName="PART_BadgeContainer" Value="{DynamicResource BadgeDotSize}" />
<Setter Property="Height" TargetName="PART_BadgeContainer" Value="{DynamicResource BadgeDotSize}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Count" Value="0" />
<Condition Property="ShowZero" Value="False" />
</MultiTrigger.Conditions>
<Setter Property="Visibility" TargetName="PART_BadgeContainer" Value="Collapsed" />
</MultiTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<ControlTemplate TargetType="{x:Type controls:Badge}" x:Key="Ant.BadgeStatusTemplate">
<Grid>
<Grid.ColumnDefinitions>
<!-- Dot -->
<ColumnDefinition Width="*" />
<!-- Text -->
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
<!-- Effect -->
<Ellipse
Height="{TemplateBinding BadgeHeight}"
Opacity="0"
RenderTransformOrigin="0.5,0.5"
Stroke="{TemplateBinding BadgeBackground}"
StrokeThickness="1"
UseLayoutRounding="True"
Width="{TemplateBinding BadgeHeight}"
x:Name="Effect">
<Ellipse.RenderTransform>
<ScaleTransform x:Name="EffectTransform" />
</Ellipse.RenderTransform>
</Ellipse>
<!-- Dot -->
<Ellipse
Fill="{TemplateBinding BadgeBackground}"
Height="{TemplateBinding BadgeHeight}"
UseLayoutRounding="True"
VerticalAlignment="Center"
Width="{TemplateBinding BadgeHeight}"
x:Name="Dot" />
<!-- Content -->
<ContentControl
Content="{TemplateBinding Text}"
Grid.Column="1"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}" />
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="Status" Value="Processing">
<Trigger.EnterActions>
<BeginStoryboard Storyboard="{StaticResource Ant.BadgeEffectStoryboard}" />
</Trigger.EnterActions>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
<Style TargetType="{x:Type controls:Badge}">
<Setter Property="Foreground" Value="White" />
<Setter Property="FontSize" Value="{DynamicResource BadgeFontSize}" />
<Setter Property="FontWeight" Value="{DynamicResource BadgeFontWeight}" />
<Setter Property="BadgeHeight" Value="{DynamicResource BadgeHeight}" />
<Setter Property="Background" Value="{DynamicResource HighlightBrush}" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:Badge}">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<!-- Content -->
<ContentPresenter
Content="{TemplateBinding Content}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
Grid.ColumnSpan="2"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}"
Margin="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
x:Name="Content" />
<!-- Effect -->
<Ellipse
Height="{DynamicResource BadgeStatusSize}"
Opacity="0"
RenderTransformOrigin="0.5,0.5"
Stroke="{DynamicResource ProcessingBrush}"
StrokeThickness="1"
UseLayoutRounding="True"
Width="{DynamicResource BadgeStatusSize}"
x:Name="Effect">
<Ellipse.RenderTransform>
<ScaleTransform x:Name="EffectTransform" />
</Ellipse.RenderTransform>
</Ellipse>
<!-- Dot -->
<Border
Background="{TemplateBinding Background}"
CornerRadius="{Binding Height, RelativeSource={RelativeSource Self}, Converter={StaticResource DoubleToCornerRadiusConverter}, ConverterParameter=2}"
Grid.ColumnSpan="2"
Height="{TemplateBinding BadgeHeight}"
HorizontalAlignment="Right"
MinWidth="{TemplateBinding BadgeHeight}"
UseLayoutRounding="True"
VerticalAlignment="Top"
x:Name="Dot">
<ContentPresenter
HorizontalAlignment="Center"
Margin="6,0"
VerticalAlignment="Center"
x:Name="PART_Count" />
</Border>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="Dot" Value="True">
<Setter Property="Visibility" TargetName="PART_Count" Value="Collapsed" />
<Setter Property="Width" TargetName="Dot" Value="{DynamicResource BadgeDotSize}" />
<Setter Property="Height" TargetName="Dot" Value="{DynamicResource BadgeDotSize}" />
<Setter Property="MinWidth" TargetName="Dot" Value="0" />
</Trigger>
<Trigger Property="Status" Value="Success">
<Setter Property="Background" TargetName="Dot" Value="{DynamicResource SuccessBrush}" />
</Trigger>
<Trigger Property="Status" Value="Processing">
<Trigger.EnterActions>
<BeginStoryboard>
<Storyboard>
<DoubleAnimation
Duration="0:0:1.2"
EasingFunction="{StaticResource EaseInOut}"
From="0.5"
RepeatBehavior="Forever"
Storyboard.TargetName="Effect"
Storyboard.TargetProperty="(UIElement.Opacity)"
To="0" />
<DoubleAnimation
Duration="0:0:1.2"
EasingFunction="{StaticResource EaseInOut}"
From="0.8"
RepeatBehavior="Forever"
Storyboard.TargetName="EffectTransform"
Storyboard.TargetProperty="ScaleX"
To="2.4" />
<DoubleAnimation
Duration="0:0:1.2"
EasingFunction="{StaticResource EaseInOut}"
From="0.8"
RepeatBehavior="Forever"
Storyboard.TargetName="EffectTransform"
Storyboard.TargetProperty="ScaleY"
To="2.4" />
</Storyboard>
</BeginStoryboard>
</Trigger.EnterActions>
<Setter Property="Background" TargetName="Dot" Value="{DynamicResource ProcessingBrush}" />
</Trigger>
<Trigger Property="Status" Value="Default">
<Setter Property="Background" TargetName="Dot" Value="{DynamicResource NormalBrush}" />
</Trigger>
<Trigger Property="Status" Value="Error">
<Setter Property="Background" TargetName="Dot" Value="{DynamicResource ErrorBrush}" />
</Trigger>
<Trigger Property="Status" Value="Warning">
<Setter Property="Background" TargetName="Dot" Value="{DynamicResource WarningBrush}" />
</Trigger>
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Count" Value="0" />
<Condition Property="ShowZero" Value="False" />
</MultiTrigger.Conditions>
<Setter Property="Visibility" TargetName="Dot" Value="Collapsed" />
</MultiTrigger>
<DataTrigger Binding="{Binding Status, RelativeSource={RelativeSource Self}, Converter={StaticResource IsNullConverter}}" Value="False">
<Setter Property="Visibility" TargetName="PART_Count" Value="Collapsed" />
<Setter Property="Width" TargetName="Dot" Value="{DynamicResource BadgeStatusSize}" />
<Setter Property="Height" TargetName="Dot" Value="{DynamicResource BadgeStatusSize}" />
<Setter Property="Visibility" TargetName="Dot" Value="Visible" />
<Setter Property="MinWidth" TargetName="Dot" Value="0" />
</DataTrigger>
<!-- Stateful and no content -->
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Content, RelativeSource={RelativeSource Self}, Converter={StaticResource IsNullConverter}}" Value="True" />
<Condition Binding="{Binding Status, RelativeSource={RelativeSource Self}, Converter={StaticResource IsNullConverter}}" Value="False" />
</MultiDataTrigger.Conditions>
<Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
<Setter Property="FontSize" Value="{DynamicResource FontSizeBase}" />
<Setter Property="VerticalAlignment" TargetName="Dot" Value="Center" />
<Setter Property="HorizontalAlignment" TargetName="Dot" Value="Left" />
<Setter Property="Grid.ColumnSpan" TargetName="Dot" Value="1" />
<Setter Property="VerticalAlignment" TargetName="Content" Value="Center" />
<Setter Property="HorizontalAlignment" TargetName="Content" Value="Left" />
<Setter Property="Margin" TargetName="Content" Value="8,0,0,0" />
<Setter Property="Grid.ColumnSpan" TargetName="Content" Value="1" />
<Setter Property="Grid.Column" TargetName="Content" Value="1" />
<Setter Property="Content" TargetName="Content" Value="{Binding Text, RelativeSource={RelativeSource Mode=TemplatedParent}}" />
</MultiDataTrigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<Style TargetType="{x:Type controls:Badge}" x:Key="666">
<Setter Property="BadgeForeground" Value="White" />
<Setter Property="BadgeHeight" Value="{DynamicResource BadgeHeight}" />
<Setter Property="BadgeBackground" Value="{DynamicResource HighlightBrush}" />
<Setter Property="Template" Value="{StaticResource Ant.BadgeTemplate}" />
<Style.Triggers>
<Trigger Property="Status" Value="Success">
<Setter Property="BadgeBackground" Value="{DynamicResource SuccessBrush}" />
</Trigger>
<Trigger Property="Status" Value="Processing">
<Setter Property="BadgeBackground" Value="{DynamicResource ProcessingBrush}" />
</Trigger>
<Trigger Property="Status" Value="Default">
<Setter Property="BadgeBackground" Value="{DynamicResource NormalBrush}" />
</Trigger>
<Trigger Property="Status" Value="Error">
<Setter Property="BadgeBackground" Value="{DynamicResource ErrorBrush}" />
</Trigger>
<Trigger Property="Status" Value="Warning">
<Setter Property="BadgeBackground" Value="{DynamicResource WarningBrush}" />
</Trigger>
<DataTrigger Binding="{Binding Status, RelativeSource={RelativeSource Self}, Converter={StaticResource IsNullConverter}}" Value="False">
<Setter Property="BadgeHeight" Value="{DynamicResource BadgeStatusSize}" />
</DataTrigger>
<MultiDataTrigger>
<MultiDataTrigger.Conditions>
<Condition Binding="{Binding Content, RelativeSource={RelativeSource Self}, Converter={StaticResource IsNullConverter}}" Value="True" />
<Condition Binding="{Binding Status, RelativeSource={RelativeSource Self}, Converter={StaticResource IsNullConverter}}" Value="False" />
</MultiDataTrigger.Conditions>
<Setter Property="Padding" Value="8,0,0,0" />
<Setter Property="VerticalAlignment" Value="Center" />
<Setter Property="HorizontalAlignment" Value="Left" />
<Setter Property="Foreground" Value="{DynamicResource TextBrush}" />
<Setter Property="FontSize" Value="{DynamicResource FontSizeBase}" />
<Setter Property="Template" Value="{StaticResource Ant.BadgeStatusTemplate}" />
</MultiDataTrigger>
</Style.Triggers>
</Style>
</ResourceDictionary>

View File

@@ -1,72 +1,106 @@
<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:controls="clr-namespace:AntdWpf.Controls"
xmlns:helpers="clr-namespace:AntdWpf.Helpers">
<ResourceDictionary
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:controls="clr-namespace:AntDesign.WPF.Controls"
xmlns:helpers="clr-namespace:AntDesign.WPF.Helpers"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<ResourceDictionary.MergedDictionaries>
<ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Styles/Converters.xaml" />
<ResourceDictionary Source="pack://application:,,,/AntdWpf;component/Styles/Animations.xaml" />
<ResourceDictionary Source="pack://application:,,,/AntDesign.WPF;component/Styles/Converters.xaml" />
<ResourceDictionary Source="pack://application:,,,/AntDesign.WPF;component/Styles/Animations.xaml" />
</ResourceDictionary.MergedDictionaries>
<Style TargetType="{x:Type controls:AntButton}">
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="VerticalContentAlignment" Value="Center" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="FontSize" Value="{DynamicResource FontSizeBase}" />
<Setter Property="Height" Value="{DynamicResource ButtonHeightBase}" />
<Setter Property="EffectBrush" Value="{DynamicResource PrimaryBrush}" />
<Setter Property="Padding" Value="{DynamicResource ButtonPaddingBase}" />
<Setter Property="FontWeight" Value="{DynamicResource ButtonFontWeight}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultBorder}" />
<Style TargetType="{x:Type controls:AntdButton}">
<Setter Property="Background" Value="{DynamicResource ButtonDefaultBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultForeground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDefaultBorder}" />
<Setter Property="BorderThickness" Value="{DynamicResource BorderThicknessBase}" />
<!-- <Setter Property="Effect">
<Setter.Value>
<DropShadowEffect Color="Black"
BlurRadius="10"
Direction="270"
Opacity="0.4"
ShadowDepth="5" />
</Setter.Value>
</Setter>-->
<Setter Property="EffectBrush" Value="{DynamicResource PrimaryBrush}" />
<Setter Property="FocusVisualStyle" Value="{x:Null}" />
<Setter Property="Cursor" Value="Hand" />
<Setter Property="FontSize" Value="{DynamicResource FontSizeBase}" />
<Setter Property="FontWeight" Value="{DynamicResource ButtonFontWeight}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDefaultForeground}" />
<Setter Property="Height" Value="{DynamicResource ButtonHeightBase}" />
<Setter Property="helpers:AntdControl.BorderStyle" Value="{DynamicResource BorderStyleBase}" />
<Setter Property="helpers:AntdControl.CornerRadius" Value="{DynamicResource ButtonBorderRadiusBase}" />
<Setter Property="HorizontalContentAlignment" Value="Center" />
<Setter Property="Padding" Value="{DynamicResource ButtonPaddingBase}" />
<Setter Property="SnapsToDevicePixels" Value="True" />
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="{x:Type controls:AntButton}">
<ControlTemplate TargetType="{x:Type controls:AntdButton}">
<Grid>
<!-- Effect -->
<Border x:Name="Effect"
Margin="-1"
Opacity="0.4"
Focusable="False"
BorderThickness="0"
BorderBrush="{TemplateBinding EffectBrush}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
CornerRadius="{TemplateBinding helpers:AntdControl.CornerRadius}" />
<!-- Border -->
<controls:AntdBorder x:Name="PART_Border"
UseLayoutRounding="True"
Padding="{TemplateBinding Padding}"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
BorderStyle="{TemplateBinding helpers:AntdControl.BorderStyle}"
CornerRadius="{TemplateBinding helpers:AntdControl.CornerRadius}">
<!-- Content -->
<Grid VerticalAlignment="{TemplateBinding VerticalContentAlignment}"
HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}">
<Border
Background="{TemplateBinding Background}"
CornerRadius="{TemplateBinding helpers:AntdControl.CornerRadius}"
Margin="0,6,0,0"
Opacity="0.25"
Panel.ZIndex="0"
RenderTransformOrigin="0.5,0.5"
x:Name="ReflectionLayer">
<Border.RenderTransform>
<ScaleTransform ScaleX="1.02" ScaleY="1.03" />
</Border.RenderTransform>
</Border>
<!-- Effect -->
<Border
BorderBrush="{TemplateBinding EffectBrush}"
BorderThickness="0"
CornerRadius="{TemplateBinding helpers:AntdControl.CornerRadius}"
Focusable="False"
Margin="-1"
Opacity="0.4"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
x:Name="Effect" />
<!-- Border -->
<Border
Background="Black"
CornerRadius="4"
Height="40"
HorizontalAlignment="Left"
Margin="4,4,0,0"
Opacity="0.2"
VerticalAlignment="Top"
Width="120" />
<controls:AntdBorder
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderStyle="{TemplateBinding helpers:AntdControl.BorderStyle}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="{TemplateBinding helpers:AntdControl.CornerRadius}"
Padding="{TemplateBinding Padding}"
SnapsToDevicePixels="{TemplateBinding SnapsToDevicePixels}"
UseLayoutRounding="True"
x:Name="PART_Border">
<!-- Content -->
<Grid HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}">
<Grid.ColumnDefinitions>
<!-- Icon -->
<!-- Icon -->
<ColumnDefinition Width="Auto" />
<!-- Content -->
<!-- Content -->
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<controls:Icon x:Name="Icon"
Margin="0 0 8 0"
Focusable="False"
Type="{TemplateBinding Icon}" />
<ContentPresenter x:Name="Content"
Grid.Column="1"
RecognizesAccessKey="True"
Content="{TemplateBinding Content}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}" />
<controls:Icon
Focusable="False"
Margin="0,0,8,0"
Type="{TemplateBinding Icon}"
x:Name="Icon" />
<ContentPresenter
Content="{TemplateBinding Content}"
ContentStringFormat="{TemplateBinding ContentStringFormat}"
ContentTemplate="{TemplateBinding ContentTemplate}"
ContentTemplateSelector="{TemplateBinding ContentTemplateSelector}"
Grid.Column="1"
RecognizesAccessKey="True"
x:Name="Content" />
</Grid>
</controls:AntdBorder>
<VisualStateManager.VisualStateGroups>
@@ -93,8 +127,7 @@
</VisualStateGroup.Transitions>
<VisualState x:Name="Loaded">
<Storyboard>
<DoubleAnimation Storyboard.TargetProperty="Opacity"
To="0.65" />
<DoubleAnimation Storyboard.TargetProperty="Opacity" To="0.65" />
</Storyboard>
</VisualState>
<VisualState x:Name="Unloaded" />
@@ -102,26 +135,23 @@
</VisualStateManager.VisualStateGroups>
</Grid>
<ControlTemplate.Triggers>
<!-- Loading State -->
<!-- Loading State -->
<Trigger Property="Loading" Value="True">
<Setter TargetName="Icon" Property="Type" Value="loading" />
<Setter Property="Type" TargetName="Icon" Value="loading" />
</Trigger>
<!-- Content State -->
<!-- Content State -->
<Trigger Property="Content" Value="{x:Null}">
<Setter TargetName="Icon" Property="Margin" Value="0" />
<Setter TargetName="Icon" Property="Grid.ColumnSpan" Value="2" />
<Setter Property="Grid.ColumnSpan" TargetName="Icon" Value="2" />
<Setter Property="Margin" TargetName="Icon" Value="0" />
</Trigger>
<Trigger SourceName="Icon" Property="Type" Value="{x:Null}">
<Setter TargetName="Content" Property="Grid.Column" Value="0" />
<Setter TargetName="Content" Property="Grid.ColumnSpan" Value="2" />
<Setter TargetName="Icon" Property="Visibility" Value="Collapsed" />
<Trigger Property="Type" SourceName="Icon" Value="{x:Null}">
<Setter Property="Grid.Column" TargetName="Content" Value="0" />
<Setter Property="Grid.ColumnSpan" TargetName="Content" Value="2" />
<Setter Property="Visibility" TargetName="Icon" Value="Collapsed" />
</Trigger>
<!-- Shape Circle -->
<!-- Shape Circle -->
<Trigger Property="Shape" Value="Circle">
<Setter TargetName="Icon"
Property="FontSize"
Value="{Binding FontSize, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent},
Converter={StaticResource AdditionConverter}, ConverterParameter=2}" />
<Setter Property="FontSize" TargetName="Icon" Value="{Binding FontSize, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}, Converter={StaticResource AdditionConverter}, ConverterParameter=2}" />
</Trigger>
<EventTrigger RoutedEvent="ButtonBase.Click">
<BeginStoryboard Storyboard="{StaticResource Ant.ClickAnimating}" />
@@ -130,55 +160,75 @@
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="VerticalContentAlignment" Value="Center" />
<Style.Triggers>
<!-- Ghost State -->
<!-- Ghost State -->
<Trigger Property="Ghost" Value="True">
<Setter Property="Foreground" Value="White" />
<Setter Property="BorderBrush" Value="White" />
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="White" />
<Setter Property="Foreground" Value="White" />
</Trigger>
<!-- Primary -->
<!-- Primary -->
<Trigger Property="Type" Value="Primary">
<Setter Property="EffectBrush" Value="{DynamicResource ButtonPrimaryBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonPrimaryForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonPrimaryBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonPrimaryBackground}" />
<Setter Property="EffectBrush" Value="{DynamicResource ButtonPrimaryBackground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonPrimaryForeground}" />
</Trigger>
<!-- Dashed -->
<!-- Dashed -->
<Trigger Property="Type" Value="Dashed">
<Setter Property="helpers:AntdControl.BorderStyle" Value="Dashed" />
</Trigger>
<!-- Danger -->
<!-- Danger -->
<Trigger Property="Type" Value="Danger">
<Setter Property="EffectBrush" Value="{DynamicResource ButtonDangerForeground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDangerForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonDangerBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDangerBorder}" />
<Setter Property="EffectBrush" Value="{DynamicResource ButtonDangerForeground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDangerForeground}" />
</Trigger>
<!-- Size -->
<!-- Filled -->
<Trigger Property="Type" Value="Filled">
<Setter Property="Background" Value="{DynamicResource ButtonDangerBackground}" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="EffectBrush" Value="{DynamicResource ButtonDangerForeground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonPrimaryForeground}" />
</Trigger>
<Trigger Property="Type" Value="Text">
<Setter Property="Background" Value="{DynamicResource ButtonDangerBackground}" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="EffectBrush" Value="{DynamicResource ButtonDangerForeground}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonPrimaryForeground}" />
</Trigger>
<!-- Link -->
<Trigger Property="Type" Value="Link">
<Setter Property="Background" Value="Transparent" />
<Setter Property="BorderBrush" Value="Transparent" />
<Setter Property="EffectBrush" Value="{DynamicResource ButtonDangerForeground}" />
<Setter Property="Foreground" Value="{DynamicResource LinkActiveBrush}" />
</Trigger>
<!-- Size -->
<Trigger Property="Size" Value="Large">
<Setter Property="FontSize" Value="{DynamicResource ButtonFontSizeLarge}" />
<Setter Property="Height" Value="{DynamicResource ButtonHeightLarge}" />
<Setter Property="Padding" Value="{DynamicResource ButtonPaddingLarge}" />
<Setter Property="FontSize" Value="{DynamicResource ButtonFontSizeLarge}" />
</Trigger>
<Trigger Property="Size" Value="Small">
<Setter Property="Height" Value="{DynamicResource ButtonHeightSmall}" />
<Setter Property="Padding" Value="{DynamicResource ButtonPaddingSmall}" />
<Setter Property="FontSize" Value="{DynamicResource ButtonFontSizeSmall}" />
<Setter Property="Height" Value="{DynamicResource ButtonHeightSmall}" />
<Setter Property="helpers:AntdControl.CornerRadius" Value="{DynamicResource ButtonBorderRadiusSmall}" />
<Setter Property="Padding" Value="{DynamicResource ButtonPaddingSmall}" />
</Trigger>
<!-- Shape Circle -->
<!-- Shape Circle -->
<Trigger Property="Shape" Value="Circle">
<Setter Property="helpers:AntdControl.CornerRadius" Value="{Binding Height, Mode=OneWay, RelativeSource={RelativeSource Self}, Converter={StaticResource DoubleToCornerRadiusConverter}, ConverterParameter=2}" />
<Setter Property="Padding" Value="0" />
<Setter Property="Width" Value="{Binding Height, Mode=OneWay, RelativeSource={RelativeSource Self}}" />
<Setter Property="helpers:AntdControl.CornerRadius" Value="{Binding Height, Mode=OneWay, RelativeSource={RelativeSource Self},
Converter={StaticResource DoubleToCornerRadiusConverter}, ConverterParameter=2}" />
</Trigger>
<!-- Loading State -->
<!-- Loading State -->
<Trigger Property="Loading" Value="True">
<Setter Property="IsEnabled" Value="False" />
</Trigger>
<!-- Ghost States -->
<!-- Ghost States -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Ghost" Value="True" />
@@ -193,15 +243,15 @@
</MultiTrigger.Conditions>
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDangerForeground}" />
</MultiTrigger>
<!-- Disabled -->
<!-- Disabled -->
<MultiTrigger>
<MultiTrigger.Conditions>
<Condition Property="Loading" Value="False" />
<Condition Property="IsEnabled" Value="False" />
</MultiTrigger.Conditions>
<Setter Property="Foreground" Value="{DynamicResource ButtonDisableForeground}" />
<Setter Property="Background" Value="{DynamicResource ButtonDisableBackground}" />
<Setter Property="BorderBrush" Value="{DynamicResource ButtonDisableBorder}" />
<Setter Property="Foreground" Value="{DynamicResource ButtonDisableForeground}" />
</MultiTrigger>
</Style.Triggers>
</Style>

Some files were not shown because too many files have changed in this diff Show More