Example 
Layers Property (RenderContextBase)
Gets a collection of RenderOperationLayer layers, which allow rendering operations to be posted to a layered queue for later execution in order (and correct Z-ordering).
Syntax
public abstract RenderOperationLayers Layers {get;}
Example
Demonstrates how to enqueue operations to the RenderOperationLayers collection and later flush to ensure rendering operations get processed in the correct Z-order
RenderOperationLayers layers = renderContext.Layers;
 
// Enqueue some operations in the layers in any order
layers[RenderLayer.AxisMajorGridlines].Enqueue(() => renderContext.DrawLine(/* .. */));
layers[RenderLayer.AxisBands].Enqueue(() => renderContext.DrawRectangle(/* .. */));
layers[RenderLayer.AxisMinorGridlines].Enqueue(() => renderContext.DrawLine(/* .. */));
 
// Processes all layers by executing enqueued operations in order of adding, 
// and in Z-order of layers
layers.Flush();
Requirements

Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

See Also