public static bool GetChangedSatesProperty(DependencyObject obj)
{
return (bool)obj.GetValue(ChangedSatesProperty);
}
public static void SetChangedSatesProperty(DependencyObject obj, bool value)
{
obj.SetValue(ChangedSatesProperty, value);
}
public static readonly DependencyProperty ChangedSatesProperty =
DependencyProperty.RegisterAttached(
"ChangedSatesProperty",
typeof(bool),
typeof(StateManager),
new PropertyMetadata((dependencyObject, args) =>
{
var frameworkElement = dependencyObject as FrameworkElement;
if (frameworkElement == null && !(bool)args.NewValue)
return;
if (frameworkElement != null)
{
WPF 自定义附加属性
最新推荐文章于 2024-02-26 17:39:56 发布