[]
Represents a drawing layer with visuals, optional clipping, and nested layers.
public class Layer
public Layer BaseLayer { get; }
public Layer BottomNestedLayer { get; }
public Visual BottomVisual { get; }
Gets or sets a LayoutRect that affects the transformation matrix when clipping this Layer.
If the CreateClipRegion delegate is not assigned, the ClipRect rectangle is also used as a clipping region.
public LayoutRect ClipRect { get; set; }
Gets or sets a delegate that creates a clipping region (IClipRegion) taking GcGraphics and Layer as parameters.
The transformation matrix of the clipping region is defined by the ClipRect.Transform property. If the ClipRect property is not assigned, the transformation matrix of the owner View is used.
public Func<GcGraphics, Layer, IClipRegion> CreateClipRegion { get; set; }
Gets or sets a delegate that accepts a GcGraphics object and a Layer and draws the layer on the graphics.
public Action<GcGraphics, Layer> Draw { get; set; }
public bool IsDetached { get; }
public Layer LayerAbove { get; }
public Layer LayerBelow { get; }
Gets or sets the name of this Layer.
public string Name { get; set; }
Gets the owner Surface object.
public Surface Surface { get; }
Gets or sets an object that contains arbitrary data associated with this layer.
public object Tag { get; set; }
public Layer TopNestedLayer { get; }
public Visual TopVisual { get; }
If the current object is a Layer, gets the owner View. If the current object is a View, gets this object.
public View View { get; }
Gets or sets a value indicating whether this Layer is visible.
public bool Visible { get; set; }
Moves the layer to the front. It becomes the topmost nested layer of the base Layer or the top layer of the Surface.
public void BringToFront()
Creates a Space object that represents an invisible helper rectangle for easy layout of other elements.
public Space CreateSpace()
Creates a Space object that represents an invisible helper rectangle for easy layout of other elements.
public Space CreateSpace(int id)
id
intA custom space ID. It must be positive and unique within the View.
Creates a nested Layer object and adds it on top of other nested layers.
public Layer CreateSubLayer()
Creates a nested Layer object and adds it on top of other nested layers.
public Layer CreateSubLayer(Action<GcGraphics, Layer> draw)
draw
System.Action<T1, T2><GcGraphics, Layer>A delegate that accepts a GcGraphics object and a Layer, and draws the layer on the graphics.
Creates a nested View object and adds it on top of other nested layers.
public View CreateSubView(float width, float height, Action<GcGraphics, Layer> draw)
width
floatThe width of the LayoutView rectangle.
height
floatThe height of the LayoutView rectangle.
draw
System.Action<T1, T2><GcGraphics, Layer>A delegate that accepts a GcGraphics object and a Layer, and draws the layer on the graphics.
Creates a nested View object and adds it on top of other nested layers.
public View CreateSubView(float width, float height)
width
floatThe width of the LayoutView rectangle.
height
floatThe height of the LayoutView rectangle.
Creates a Visual object that represents a polygon based on the given AnchorPoints.
public Visual CreateVisual(AnchorPoint[] anchorPoints, Action<GcGraphics, Visual> draw)
anchorPoints
AnchorPoint[]An array of AnchorPoints to draw.
draw
System.Action<T1, T2><GcGraphics, Visual>A delegate that accepts a GcGraphics object and a Visual, and draws the visual on the graphics.
Creates a Visual object that represents a polygon based on the given AnchorPoints.
public Visual CreateVisual(AnchorPoint[] anchorPoints)
anchorPoints
AnchorPoint[]An array of AnchorPoints to draw.
public Visual CreateVisual(Contour contour, bool createRect, Action<GcGraphics, Visual> draw)
contour
ContourcreateRect
boolIndicates whether a new LayoutRect must be associated with the Visual.
draw
System.Action<T1, T2><GcGraphics, Visual>A delegate that accepts a GcGraphics object and a Visual, and draws the visual on the graphics.
public Visual CreateVisual(Contour contour, bool createRect)
contour
ContourcreateRect
boolIndicates whether a new LayoutRect must be associated with the Visual.
Creates a Visual object that represents a drawing element.
public Visual CreateVisual(Action<GcGraphics, Visual> draw)
draw
System.Action<T1, T2><GcGraphics, Visual>A delegate that accepts a GcGraphics object and a Visual, and draws the visual on the graphics.
Creates a Visual object that represents a drawing element.
public Visual CreateVisual(bool createRect = true)
createRect
boolIndicates whether a new LayoutRect must be associated with the Visual.
Creates a Visual object that represents a drawing element.
public Visual CreateVisual(int id, bool createRect = true)
id
intA custom space ID. It must be positive and unique within the View.
createRect
boolIndicates whether a new LayoutRect must be associated with the Visual.
public virtual void Detach()
Returns the array of nested layers and views on this Layer.
public Layer[] GetNestedLayers()
Returns the array of Visual objects.
public Visual[] GetVisuals()
Moves the current Layer to the position on top of the specified layer
.
public void MoveAbove(Layer layer)
layer
LayerMoves the current Layer to the position below the specified layer
.
public void MoveBelow(Layer layer)
layer
LayerMoves the layer to the back. It becomes the bottom nested layer of the base Layer or the bottom layer of the Surface.
public void SendToBack()
Returns a string that represents the current Layer.
public override string ToString()