This commit is contained in:
GG Z
2025-07-31 20:12:24 +08:00
parent 4f6cd2137c
commit f209e7d3ad
426 changed files with 15854 additions and 6612 deletions

View File

@@ -1,24 +1,23 @@
using AntDesign.WPF.Controls;
namespace AntDesign.WPF.Helpers

namespace AntDesignWPF.Helpers
{
using System.ComponentModel;
using System.Windows;
using System.Windows.Media;
using WPF.Controls;
using AntDesignWPF.Controls;
/// <summary>
/// A helper class that provides various controls.
/// 提供各种控件的附加属性帮助类。
/// </summary>
public static class AntdControl
public static class AntControl
{
#region Border
public static readonly DependencyProperty CornerRadiusProperty = DependencyProperty.RegisterAttached(
"CornerRadius",
typeof(CornerRadius),
typeof(AntdControl),
typeof(AntControl),
new FrameworkPropertyMetadata(
default(CornerRadius),
FrameworkPropertyMetadataOptions.AffectsMeasure | FrameworkPropertyMetadataOptions.AffectsRender
@@ -44,7 +43,7 @@ namespace AntDesign.WPF.Helpers
public static readonly DependencyProperty BorderStyleProperty = DependencyProperty.RegisterAttached(
"BorderStyle",
typeof(BorderStyle),
typeof(AntdControl),
typeof(AntControl),
new PropertyMetadata(BorderStyle.Solid));
/// <summary>
@@ -70,7 +69,7 @@ namespace AntDesign.WPF.Helpers
public static readonly DependencyProperty SizeProperty = DependencyProperty.RegisterAttached(
"Size",
typeof(Sizes?),
typeof(AntdControl),
typeof(AntControl),
new PropertyMetadata(null));
/// <summary>
@@ -96,7 +95,7 @@ namespace AntDesign.WPF.Helpers
public static readonly DependencyProperty MouseOverForegroundProperty = DependencyProperty.RegisterAttached(
"MouseOverForeground",
typeof(Brush),
typeof(AntdControl),
typeof(AntControl),
new FrameworkPropertyMetadata(
Brushes.Transparent, FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.Inherits
));
@@ -120,7 +119,7 @@ namespace AntDesign.WPF.Helpers
public static readonly DependencyProperty MouseOverBorderBrushProperty = DependencyProperty.RegisterAttached(
"MouseOverBorderBrush",
typeof(Brush),
typeof(AntdControl),
typeof(AntControl),
new FrameworkPropertyMetadata(
Brushes.Transparent, FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.Inherits
));
@@ -144,7 +143,7 @@ namespace AntDesign.WPF.Helpers
public static readonly DependencyProperty MouseOverBackgroundProperty = DependencyProperty.RegisterAttached(
"MouseOverBackground",
typeof(Brush),
typeof(AntdControl),
typeof(AntControl),
new FrameworkPropertyMetadata(
Brushes.Transparent, FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.Inherits
));
@@ -168,7 +167,7 @@ namespace AntDesign.WPF.Helpers
public static readonly DependencyProperty FocusedForegroundProperty = DependencyProperty.RegisterAttached(
"FocusedForeground",
typeof(Brush),
typeof(AntdControl),
typeof(AntControl),
new FrameworkPropertyMetadata(
Brushes.Transparent, FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.Inherits
));
@@ -192,7 +191,7 @@ namespace AntDesign.WPF.Helpers
public static readonly DependencyProperty FocusedBorderBrushProperty = DependencyProperty.RegisterAttached(
"FocusedBorderBrush",
typeof(Brush),
typeof(AntdControl),
typeof(AntControl),
new FrameworkPropertyMetadata(
Brushes.Transparent, FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.Inherits
));
@@ -216,7 +215,7 @@ namespace AntDesign.WPF.Helpers
public static readonly DependencyProperty FocusedBackgroundProperty = DependencyProperty.RegisterAttached(
"FocusedBackground",
typeof(Brush),
typeof(AntdControl),
typeof(AntControl),
new FrameworkPropertyMetadata(
Brushes.Transparent, FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.Inherits
));
@@ -240,7 +239,7 @@ namespace AntDesign.WPF.Helpers
public static readonly DependencyProperty PressedForegroundProperty = DependencyProperty.RegisterAttached(
"PressedForeground",
typeof(Brush),
typeof(AntdControl),
typeof(AntControl),
new FrameworkPropertyMetadata(
Brushes.Transparent, FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.Inherits
));
@@ -264,7 +263,7 @@ namespace AntDesign.WPF.Helpers
public static readonly DependencyProperty PressedBorderBrushProperty = DependencyProperty.RegisterAttached(
"PressedBorderBrush",
typeof(Brush),
typeof(AntdControl),
typeof(AntControl),
new FrameworkPropertyMetadata(
Brushes.Transparent, FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.Inherits
));
@@ -288,7 +287,7 @@ namespace AntDesign.WPF.Helpers
public static readonly DependencyProperty PressedBackgroundProperty = DependencyProperty.RegisterAttached(
"PressedBackground",
typeof(Brush),
typeof(AntdControl),
typeof(AntControl),
new FrameworkPropertyMetadata(
Brushes.Transparent, FrameworkPropertyMetadataOptions.AffectsRender | FrameworkPropertyMetadataOptions.Inherits
));

View File

@@ -1,4 +1,4 @@
namespace AntDesign.WPF.Helpers
namespace AntDesignWPF.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 AntDesign.WPF.Helpers
namespace AntDesignWPF.Helpers
{
public class ProgressAssist
{

View File

@@ -0,0 +1,51 @@
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace AntDesignWPF.Helpers;
public enum TabType
{
Line, // 默认线条样式
Card // 卡片样式
}
public class TabControlHelper : DependencyObject
{
// 注册 TabType 附加属性
public static readonly DependencyProperty TabTypeProperty =
DependencyProperty.RegisterAttached(
"TabType",
typeof(TabType),
typeof(TabControlHelper),
new PropertyMetadata(TabType.Line)); // 默认值为 Line
public static void SetTabType(DependencyObject element, TabType value)
{
element.SetValue(TabTypeProperty, value);
}
public static TabType GetTabType(DependencyObject element)
{
return (TabType)element.GetValue(TabTypeProperty);
}
// 注册 IsEditable 附加属性
public static readonly DependencyProperty IsEditableProperty =
DependencyProperty.RegisterAttached(
"IsEditable",
typeof(bool),
typeof(TabControlHelper),
new PropertyMetadata(false));
public static void SetIsEditable(DependencyObject element, bool value)
{
element.SetValue(IsEditableProperty, value);
}
public static bool GetIsEditable(DependencyObject element)
{
return (bool)element.GetValue(IsEditableProperty);
}
}

View File

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