Information
The topic you requested is included in another documentation set. For convenience, it's displayed below. Choose Switch to see the topic in its original location.

FrameworkElement.OnRenderSizeChanged Method

Raises the SizeChanged event, using the specified information as part of the eventual event data.

Namespace: System.Windows
Assembly: PresentationFramework (in presentationframework.dll)

protected internal override void OnRenderSizeChanged (
	SizeChangedInfo sizeInfo
)
protected void OnRenderSizeChanged (
	SizeChangedInfo sizeInfo
)
protected internal override function OnRenderSizeChanged (
	sizeInfo : SizeChangedInfo
)
You cannot use methods in XAML.

Parameters

sizeInfo

Details of the old and new size involved in the change.

This method overrides OnRenderSizeChanged. If you call this method you will reset the ActualWidth property, the ActualHeight property, or both, depending on what is specified as changed in the supplied arguments, and will you always raise the event.

Notes to Inheritors: Do not override this method for typical layout scenarios. The layout system operates in a deliberately asynchronous way to assure that all possible layout arrange and measure cases are accounted for. The layout system override methods MeasureOverride and ArrangeOverride are usually sufficient for any required layout customization. OnRenderSizeChanged is exposed as a virtual. You can override OnRenderSizeChanged to correct for exceptional cases where a runtime behavioral change related to input events combined with control recomposition in response might give inaccurate layout information. You may still override this method in derived classes (it is protected but not sealed). Always call the base implementation to preserve the behavior mentioned above, unless you have very specific reasons for disabling default WPF framework-level rendering behavior. Failing to raise the SizeChanged event will cause non-standard layout behavior if using the standard WPF framework-level layout system implementation.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Was this page helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

Show:
© 2015 Microsoft