VisualChildrenCount    的 FrameworkElement 实现始终返回 0 或 1。  GetVisualChild。 

ArrangeOverride)。

 

 1 protected override Size MeasureOverride(Size constraint)
 2         {
 3             int visualChildrenCount = this.VisualChildrenCount;
 4             if (visualChildrenCount > 0)
 5             {
 6                 UIElement uIElement = (UIElement)this.GetVisualChild(0);
 7                 if (uIElement != null)
 8                 {
 9                     Helper.SetMeasureDataOnChild(this, uIElement, constraint);
10                     uIElement.Measure(constraint);
11                     return uIElement.DesiredSize;
12                 }
13             }
14             return new Size(0.0, 0.0);
15         }
16         protected override Size ArrangeOverride(Size arrangeBounds)
17         {
18             int visualChildrenCount = this.VisualChildrenCount;
19             if (visualChildrenCount > 0)
20             {
21                 UIElement uIElement = (UIElement)this.GetVisualChild(0);
22                 if (uIElement != null)
23                 {
24                     uIElement.Arrange(new Rect(arrangeBounds));
25                 }
26             }
27             return arrangeBounds;
28         }

 

未完。。。。。。

相关文章:

  • 2022-12-23
  • 2021-12-27
  • 2022-12-23
  • 2021-08-26
  • 2021-12-19
  • 2022-12-23
  • 2022-12-23
  • 2021-10-24
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-05-22
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案