You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 

66 lines
2.0 KiB

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
namespace B3DealerClient.Utils
{
public static class ControlAttachProperty
{
#region IconSizeProperty 字体图标大小
/// <summary>
/// 字体图标
/// </summary>
public static readonly DependencyProperty IconSizeProperty = DependencyProperty.RegisterAttached(
"IconSize", typeof(double), typeof(ControlAttachProperty), new FrameworkPropertyMetadata(12D));
public static double GetIconSize(DependencyObject d)
{
return (double)d.GetValue(IconSizeProperty);
}
public static void SetIconSize(DependencyObject obj, double value)
{
obj.SetValue(IconSizeProperty, value);
}
#endregion
#region IconMarginProperty 字体图标边距
/// <summary>
/// 字体图标
/// </summary>
public static readonly DependencyProperty IconMarginProperty = DependencyProperty.RegisterAttached(
"IconMargin", typeof(Thickness), typeof(ControlAttachProperty), new FrameworkPropertyMetadata(null));
public static Thickness GetIconMargin(DependencyObject d)
{
return (Thickness)d.GetValue(IconMarginProperty);
}
public static void SetIconMargin(DependencyObject obj, Thickness value)
{
obj.SetValue(IconMarginProperty, value);
}
#endregion
#region IsNumberPad 字体图标边距
/// <summary>
/// 字体图标
/// </summary>
public static readonly DependencyProperty IsNumberPadProperty = DependencyProperty.RegisterAttached(
"IsNumberPad", typeof(bool), typeof(ControlAttachProperty), new FrameworkPropertyMetadata(true));
public static bool GetIsNumberPad(DependencyObject d)
{
return (bool)d.GetValue(IsNumberPadProperty);
}
public static void SetIsNumberPad(DependencyObject obj, bool value)
{
obj.SetValue(IsNumberPadProperty, value);
}
#endregion
}
}