ElementCopyOptions.cs 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Threading.Tasks;
  6. using System.Windows;
  7. using FWindSoft.Wpf.Controls;
  8. namespace Test
  9. {
  10. public class ElementCopyOptions
  11. {
  12. /// <summary>
  13. /// 是否使用复制值
  14. /// </summary>
  15. public static readonly DependencyProperty UseCopyProperty = DependencyProperty.RegisterAttached("UseCopy",
  16. typeof(bool), typeof(ElementCopyOptions), new PropertyMetadata(false, null));
  17. public static bool GetUseCopy(DependencyObject obj)
  18. {
  19. return (bool)obj.GetValue(UseCopyProperty);
  20. }
  21. public static void SetUseCopy(DependencyObject obj, object value)
  22. {
  23. obj.SetValue(UseCopyProperty, value);
  24. }
  25. /// <summary>
  26. /// 复制的值信息
  27. /// </summary>
  28. public static readonly DependencyProperty CopyValueProperty = DependencyProperty.RegisterAttached("CopyValue",
  29. typeof(object), typeof(ElementCopyOptions), new PropertyMetadata(null, null));
  30. public static object GetCopyValue(DependencyObject obj)
  31. {
  32. return (object)obj.GetValue(CopyValueProperty);
  33. }
  34. public static void SetCopyValue(DependencyObject obj, object value)
  35. {
  36. obj.SetValue(CopyValueProperty, value);
  37. }
  38. }
  39. }