Occurs just before the objects in the composition tree are rendered.
Assembly: PresentationCore (in PresentationCore.dll)
Theevent is routed to the specified event handler after animation and layout have been applied to the composition tree.
// Add an event handler to update canvas background color just before it is rendered. CompositionTarget.Rendering += UpdateColor;
You can use your rendering event handler to create custom drawing content. This event handler gets called once per frame. Each time that Windows Presentation Foundation (WPF) marshals the persisted rendering data in the visual tree across to the composition tree, your event handler is called. In addition, if changes to the visual tree force updates to the composition tree, your event handler is also called. Note that your event handler is called after layout has been computed. However, you can modify layout in your event handler, which means that layout will be computed once more before rendering.
Available since 3.0
Available since 2.0
Windows Phone Silverlight
Available since 7.0