Source/OxyPlot.Avalonia/CanvasRenderContext.cs
/// <summary>
/// Creates an element of the specified type and adds it to the canvas.
/// </summary>
/// <typeparam name="T">Type of element to create.</typeparam>
/// <param name="clipOffsetX">The clip offset executable.</param>
/// <param name="clipOffsetY">The clip offset asynchronous.</param>
/// <returns>The element.</returns>
Creates an element of the specified type and adds it to the canvas.
Creates an element of the specified type and adds it to the canvas .
private T CreateAndAdd<T>(double clipOffsetX = 0, double clipOffsetY = 0) where T : global::Avalonia.Controls.Control, new()
        {
            var element = new T();
            if (clip != null)
            {
                element.Clip = new global::Avalonia.Media.RectangleGeometry(
                        new Rect(
                            clip.Value.X - clipOffsetX,
                            clip.Value.Y - clipOffsetY,
                            clip.Value.Width,
                            clip.Value.Height));
            }
            canvas.Children.Add(element);
            ApplyToolTip(element);
            return element;
        }
private T CreateAndAdd < T > ( double clipOffsetX = 0 , double clipOffsetY = 0 ) where T : global :: Avalonia . Controls . Control , new ( ) { var element = new T ( ) ; if ( clip != null ) { element . Clip = new global :: Avalonia . Media . RectangleGeometry ( new Rect ( clip . Value . X - clipOffsetX , clip . Value . Y - clipOffsetY , clip . Value . Width , clip . Value . Height ) ) ; } canvas . Children . Add ( element ) ; ApplyToolTip ( element ) ; return element ; }
Creates an element of the specified type and adds it to the canvas.
Creates an element of the specified type and adds it to the canvas .
// TODO: here we can reuse existing elements in the canvas.Children collection
None
clipOffsetX
double
The clip offset executable.
The clip offset executable .
clipOffsetY
double
The clip offset asynchronous.
The clip offset asynchronous .
typeparam
Type of element to create.
Type of element to create .