功能更新
This commit is contained in:
36
Melskin/Assists/BindingProxy.cs
Normal file
36
Melskin/Assists/BindingProxy.cs
Normal file
@@ -0,0 +1,36 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace Melskin.Assists
|
||||
{
|
||||
/// <summary>
|
||||
/// 绑定代理,用来传递绑定对象
|
||||
/// </summary>
|
||||
public class BindingProxy : Freezable
|
||||
{
|
||||
/// <inheritdoc />
|
||||
protected override Freezable CreateInstanceCore() => new BindingProxy();
|
||||
|
||||
/// <summary>
|
||||
/// 绑定实例的数据
|
||||
/// </summary>
|
||||
public object Data
|
||||
{
|
||||
get => GetValue(DataProperty);
|
||||
set { SetValue(DataProperty, value); }
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// 附加属性:Data
|
||||
/// </summary>
|
||||
public static readonly DependencyProperty DataProperty = DependencyProperty.Register(
|
||||
nameof(Data),
|
||||
typeof(object),
|
||||
typeof(BindingProxy),
|
||||
new PropertyMetadata(null)
|
||||
);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user