skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop

    Web

    Kendo UI UI for jQuery UI for Angular UI for React UI for Vue UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Test Studio Dev Edition Telerik JustMock

    CMS

    Sitefinity

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

Class DrawingService

Represents drawing service.

Inheritance
System.Object
GraphServiceBase
DrawingService
Inherited Members
GraphServiceBase.Graph
Namespace: Telerik.Windows.Diagrams.Core
Assembly: Telerik.Windows.Diagrams.Core.dll

Syntax

public class DrawingService : GraphServiceBase, IDrawingService

Constructors

DrawingService(IGraphInternal)

Initializes a new instance of the DrawingService class.

Declaration
public DrawingService(IGraphInternal graph)
Parameters
IGraphInternal graph

The graph.

Properties

ActiveShape

Gets the active shape.

Declaration
public IGeometryShape ActiveShape { get; }
Property Value
IGeometryShape

Implements
IDrawingService.ActiveShape

AnchorPoints

Gets the anchor points.

Declaration
public IEnumerable<Point> AnchorPoints { get; }
Property Value
System.Collections.Generic.IEnumerable<System.Windows.Point>

Implements
IDrawingService.AnchorPoints

ControlPoints

Gets the control points.

Declaration
public IEnumerable<Point> ControlPoints { get; }
Property Value
System.Collections.Generic.IEnumerable<System.Windows.Point>

Implements
IDrawingService.ControlPoints

IsDrawing

Gets a value indicating whether this instance is drawing.

Declaration
public bool IsDrawing { get; }
Property Value
System.Boolean

Implements
IDrawingService.IsDrawing

Methods

ClearPoints()

Clears the anchor and control points.

Declaration
public void ClearPoints()
Implements
IDrawingService.ClearPoints()

CompleteDraw()

Completes the draw.

Declaration
public virtual void CompleteDraw()
Implements
IDrawingService.CompleteDraw()

CreateDrawCommand(IGeometryShape, DrawingState, DrawingState, Boolean, Boolean, DrawingShapeInfo)

Creates the DrawCommand that sets the new state of the Shape or reverts the old state.

Declaration
public DrawCommand CreateDrawCommand(IGeometryShape shape, DrawingState oldState, DrawingState newState, bool isComplete, bool isUndoable, DrawingShapeInfo shapeInfo)
Parameters
IGeometryShape shape

DrawingState oldState

DrawingState newState

System.Boolean isComplete

System.Boolean isUndoable

DrawingShapeInfo shapeInfo

Returns
DrawCommand

Implements
IDrawingService.CreateDrawCommand(IGeometryShape, DrawingState, DrawingState, Boolean, Boolean, DrawingShapeInfo)

CreateHandlesGeometry(Point, Point, FillRule)

Create geometry for the Path Handles in Path Tool.

Declaration
public Geometry CreateHandlesGeometry(Point startPoint, Point endPoint, FillRule fillRule)
Parameters
System.Windows.Point startPoint

System.Windows.Point endPoint

System.Windows.Media.FillRule fillRule

Returns
System.Windows.Media.Geometry

Implements
IDrawingService.CreateHandlesGeometry(Point, Point, FillRule)

CreateShapeGeometry(IEnumerable<DrawingToolSegment>, DrawingShapeInfo)

Creates Geometry for a shape from a given DrawingToolSegments.

Declaration
public Geometry CreateShapeGeometry(IEnumerable<DrawingToolSegment> segments, DrawingShapeInfo shapeInfo)
Parameters
System.Collections.Generic.IEnumerable<DrawingToolSegment> segments

DrawingShapeInfo shapeInfo

Returns
System.Windows.Media.Geometry

Implements
IDrawingService.CreateShapeGeometry(IEnumerable<DrawingToolSegment>, DrawingShapeInfo)

DrawPoints(Nullable<Point>, Nullable<Point>, Boolean)

Draws the points.

Declaration
public virtual bool DrawPoints(Nullable<Point> anchorPoint, Nullable<Point> controlPoint, bool isUndoable = false)
Parameters
System.Nullable<System.Windows.Point> anchorPoint

The anchor point.

System.Nullable<System.Windows.Point> controlPoint

The control point.

System.Boolean isUndoable

The is undoable.

Returns
System.Boolean

Implements
IDrawingService.DrawPoints(Nullable<Point>, Nullable<Point>, Boolean)

InitializeDraw(IGeometryShape, String)

Initializes draw action.

Declaration
public virtual void InitializeDraw(IGeometryShape activeShape, string toolName)
Parameters
IGeometryShape activeShape

The active shape.

System.String toolName

The name of the current tool.

Implements
IDrawingService.InitializeDraw(IGeometryShape, String)

RemoveLastAnchorPoint()

Removes the last anchor point.

Declaration
public void RemoveLastAnchorPoint()
Implements
IDrawingService.RemoveLastAnchorPoint()

RemoveLastControlPoint()

Removes the last control point.

Declaration
public void RemoveLastControlPoint()
Implements
IDrawingService.RemoveLastControlPoint()

SetState(IGeometryShape, IEnumerable<Point>, IEnumerable<Point>)

Sets the state.

Declaration
public void SetState(IGeometryShape shape, IEnumerable<Point> anchorPoints, IEnumerable<Point> controlPoints)
Parameters
IGeometryShape shape

The shape.

System.Collections.Generic.IEnumerable<System.Windows.Point> anchorPoints

The anchor points.

System.Collections.Generic.IEnumerable<System.Windows.Point> controlPoints

The control points.

Implements
IDrawingService.SetState(IGeometryShape, IEnumerable<Point>, IEnumerable<Point>)

StartDraw()

Starts the draw.

Declaration
public virtual void StartDraw()
Implements
IDrawingService.StartDraw()

Events

Drawing

Occurs when drawing.

Declaration
public event EventHandler<DrawingEventArgs> Drawing
Event Type
System.EventHandler<DrawingEventArgs>

Implements
IDrawingService.Drawing

Extension Methods

CollectionExtensions.ToEnumerable<T>(T)
EnumerableExtensions.ToEnumerable<T>(T)
Getting Started
  • Install Now
  • Demos
  • SDK Samples Browser
  • Sample Applications
Support Resources
  • Code Library
  • Knowledge Base
  • MVVM Support
  • Videos
  • GitHub SDK Repository
Community
  • Forums
  • Blogs
  • XAML Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.