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,14 +1,12 @@
using System;
using System.ComponentModel;
using System.ComponentModel;
using System.Diagnostics;
using System.Windows;
using System.Windows.Documents;
using System.Windows.Media;
using AntDesign.WPF.Contracts;
using AntDesign.WPF.Utils;
namespace AntDesign.WPF.Controls;
using AntDesignWPF.Contracts;
using AntDesignWPF.Utils;
namespace AntDesignWPF.Controls;
/// <summary>
/// 头像、警告提示语义矢量图形
/// </summary>
@@ -209,7 +207,11 @@ public class Icon : FrameworkElement, ISpinable
private static void OnSpinChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
{
(d as Icon).SetSpinAnimation();
if (d is Icon icon)
{
icon.SetSpinAnimation();
}
//(d as Icon).SetSpinAnimation();
}
#endregion
@@ -341,8 +343,6 @@ public class Icon : FrameworkElement, ISpinable
// Need to use colorful render.
if (geometry is GeometryGroup)
{
Brush brush;
int index = 0;
var isSolidColor = foreground is SolidColorBrush;
var children = ((GeometryGroup)geometry).Children;
@@ -352,15 +352,17 @@ public class Icon : FrameworkElement, ISpinable
if (rendered != Geometry.Empty)
{
brush = rendered.GetValue(FillProperty) as Brush;
Brush brush = rendered.GetValue(FillProperty) as Brush;
// It may need to be tinted
if (brush == null)
{
int index = 0;
if (!isSolidColor || index == 0 || index == 6 || index > 9)
{
brush = foreground;
}else
}
else
{
brush = new SolidColorBrush(ColorPalette.Toning(((SolidColorBrush)foreground).Color, index));
}
@@ -382,7 +384,7 @@ public class Icon : FrameworkElement, ISpinable
}
}
// Without background, the mouse can penetrate geometry and cause event failure.
// 如果没有背景,鼠标可能会穿透几何体并导致事件失败。
var background = Background;
if (background != null)