29 lines
709 B
C#
29 lines
709 B
C#
|
|
using System;
|
|||
|
|
using System.Collections.Generic;
|
|||
|
|
using System.Text;
|
|||
|
|
using System.Windows;
|
|||
|
|
|
|||
|
|
namespace Sai.Toolkit.Mvvm
|
|||
|
|
{
|
|||
|
|
/// <summary>
|
|||
|
|
/// 绑定代理,用来传递绑定对象
|
|||
|
|
/// </summary>
|
|||
|
|
public class BindingProxy : Freezable
|
|||
|
|
{
|
|||
|
|
protected override Freezable CreateInstanceCore() => new BindingProxy();
|
|||
|
|
|
|||
|
|
public object Data
|
|||
|
|
{
|
|||
|
|
get { return (object)GetValue(DataProperty); }
|
|||
|
|
set { SetValue(DataProperty, value); }
|
|||
|
|
}
|
|||
|
|
|
|||
|
|
// Using a DependencyProperty as the backing store for Data. This enables animation, styling, binding, etc...
|
|||
|
|
public static readonly DependencyProperty DataProperty = DependencyProperty.Register(
|
|||
|
|
nameof(Data),
|
|||
|
|
typeof(object),
|
|||
|
|
typeof(BindingProxy)
|
|||
|
|
);
|
|||
|
|
}
|
|||
|
|
}
|