UIElement.OnChildDesiredSizeChanged(UIElement) Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Supports layout behavior when a child element is resized.
protected:
virtual void OnChildDesiredSizeChanged(System::Windows::UIElement ^ child);
protected virtual void OnChildDesiredSizeChanged (System.Windows.UIElement child);
abstract member OnChildDesiredSizeChanged : System.Windows.UIElement -> unit
override this.OnChildDesiredSizeChanged : System.Windows.UIElement -> unit
Protected Overridable Sub OnChildDesiredSizeChanged (child As UIElement)
Parameters
- child
- UIElement
The child element that is being resized.
Remarks
This method is typically not called by your application code. It is exposed so that derived element classes can make further checks on their own possibly invalid layout state. Classes could also attempt optimizations to minimize the processing time for a layout pass based on size changes to child elements. An example derived element class that implements OnChildDesiredSizeChanged is the Grid control.
Notes to Inheritors
The OnChildDesiredSizeChanged(UIElement) method has the default implementation of calling InvalidateMeasure() on itself. A typical implementation would be: do whatever optimization your own element supports, and then typically call base OnChildDesiredSizeChanged(UIElement) from at least one of the code branches (the one that indicated "dirty" state per your own measure caching logic).
This method is only called in the layout processing if it was the child itself that originated the size changes. Otherwise, if the parent element initiates the Measure(Size) pass, according to the layout system rules, the parent is recalculating layout already. The layout system processes layout in the order of child-to-parent, so no return to parent element sizing from the child element layout calls is necessary.
Applies to
.NET
피드백
https://aka.ms/ContentUserFeedback
출시 예정: 2024년 내내 콘텐츠에 대한 피드백 메커니즘으로 GitHub 문제를 단계적으로 폐지하고 이를 새로운 피드백 시스템으로 바꿀 예정입니다. 자세한 내용은 다음을 참조하세요.다음에 대한 사용자 의견 제출 및 보기