BindingProxy.cs 771 B

123456789101112131415161718192021222324252627282930
  1. ///////////////////////////////////////////////////////////////////////////////
  2. using System.Windows;
  3. namespace FWindSoft.Wpf
  4. {
  5. public class BindingProxy:Freezable
  6. {
  7. /*
  8. Freezable要深入理解
  9. */
  10. protected override Freezable CreateInstanceCore()
  11. {
  12. return new BindingProxy();
  13. }
  14. public static readonly DependencyProperty DataProperty = DependencyProperty.Register("Data", typeof (object),
  15. typeof (BindingProxy), new UIPropertyMetadata(null));
  16. /// <summary>
  17. /// 关联数据
  18. /// </summary>
  19. public object Data
  20. {
  21. get { return (object) GetValue(DataProperty); }
  22. set { SetValue(DataProperty, value); }
  23. }
  24. }
  25. }