BaseAdorner.cs 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  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 System.Windows.Documents;
  9. using System.Windows.Input;
  10. using System.Windows.Media;
  11. namespace FWindSoft.Wpf.Controls
  12. {
  13. /// <summary>
  14. /// 基础修饰框
  15. /// </summary>
  16. public class BaseAdorner : Adorner
  17. {
  18. protected VisualCollection m_Children;
  19. public BaseAdorner(UIElement uiElement) : base(uiElement)
  20. {
  21. m_Children = new VisualCollection(this);
  22. }
  23. protected override Visual GetVisualChild(int index)
  24. {
  25. return m_Children[index];
  26. }
  27. protected override int VisualChildrenCount
  28. {
  29. get
  30. {
  31. return m_Children.Count;
  32. }
  33. }
  34. protected override Size MeasureOverride(Size availableSize)
  35. {
  36. return base.MeasureOverride(availableSize);
  37. }
  38. protected override Size ArrangeOverride(Size finalSize)
  39. {
  40. //this.m_Child.Arrange(new Rect(new Point(0, 0), finalSize));
  41. return base.ArrangeOverride(finalSize);
  42. }
  43. }
  44. }