CopyValueProvider.cs 803 B

12345678910111213141516171819202122232425262728293031323334
  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 System.Windows.Controls;
  8. using FWindSoft.Wpf.History;
  9. namespace Test.CopyCell
  10. {
  11. public class CopyValueProvider : ElementValueProvider
  12. {
  13. public override object GetValue()
  14. {
  15. if (RefControl == null)
  16. return null;
  17. return ElementCopyOptions.GetCopyValue(RefControl);
  18. }
  19. public override void SetValue(object value)
  20. {
  21. if (RefControl == null)
  22. return;
  23. ElementCopyOptions.SetCopyValue(RefControl,value);
  24. }
  25. protected override Type GetControlType()
  26. {
  27. return typeof(FrameworkElement);
  28. }
  29. }
  30. }