Class TextAnnotationViewModel
Represents a block of text that can be displayed over a node or connector.
Inheritance
Namespace: Syncfusion.UI.Xaml.Diagram
Assembly: Syncfusion.SfDiagram.WPF.dll
Syntax
public class TextAnnotationViewModel : Object, ITextAnnotation, INodeAnnotation, IAnnotation, INotifyPropertyChanged
Constructors
TextAnnotationViewModel()
Initializes a new instance of the TextAnnotationViewModel class.
Declaration
public TextAnnotationViewModel()
Properties
AnnotationRelativeMode
Gets or sets whether the annotation placed on bounds or path.
Declaration
public AnnotationRelativeMode AnnotationRelativeMode { get; set; }
Property Value
Type |
---|
AnnotationRelativeMode |
Background
Gets or sets a brush that describes the background.
Declaration
public Brush Background { get; set; }
Property Value
Type |
---|
System.Windows.Media.Brush |
Constraints
Gets or sets the constraints of the annotation.
Declaration
public AnnotationConstraints Constraints { get; set; }
Property Value
Type |
---|
AnnotationConstraints |
Content
Gets or sets the Content of the Annotation.
Declaration
public object Content { get; set; }
Property Value
Type |
---|
System.Object |
Displacement
Gets or sets the distance to place the annotation over the connector path (Absolute).
Declaration
public double Displacement { get; set; }
Property Value
Type |
---|
System.Double |
DragLimit
To set the DragLimit of the annotation.
Declaration
public Thickness DragLimit { get; set; }
Property Value
Type |
---|
System.Windows.Thickness |
EditTemplate
Gets or sets the data template used to display the annotation in editmode.
Declaration
public DataTemplate EditTemplate { get; set; }
Property Value
Type |
---|
System.Windows.DataTemplate |
FontFamily
Gets or sets the fontfamily of the annotation.
Declaration
public FontFamily FontFamily { get; set; }
Property Value
Type |
---|
System.Windows.Media.FontFamily |
FontSize
Gets or sets the size of the text.
Declaration
public double FontSize { get; set; }
Property Value
Type |
---|
System.Double |
FontStyle
Gets or sets the FontStyle of the Annotation.
Declaration
public FontStyle FontStyle { get; set; }
Property Value
Type |
---|
System.Windows.FontStyle |
FontWeight
Gets or sets the FontWeight of the Annotation.
Declaration
public FontWeight FontWeight { get; set; }
Property Value
Type |
---|
System.Windows.FontWeight |
Foreground
Gets or sets a brush that describes the foreground color.
Declaration
public Brush Foreground { get; set; }
Property Value
Type |
---|
System.Windows.Media.Brush |
HorizontalAlignment
Gets or sets the horizontal alignment characteristics applied to this element when it is composed within a parent element such as a node or connector.
Declaration
public HorizontalAlignment HorizontalAlignment { get; set; }
Property Value
Type |
---|
System.Windows.HorizontalAlignment |
LabelWidth
Gets or sets the width of the annotation(the maximum value of label width and the node width will be considered as label width).
Declaration
public double LabelWidth { get; set; }
Property Value
Type |
---|
System.Double |
Length
Gets or sets the distance to place the annotation over the Connector path (Fraction).
Declaration
public double Length { get; set; }
Property Value
Type |
---|
System.Double |
Margin
Gets or sets the outer margin of an element.
Declaration
public Thickness Margin { get; set; }
Property Value
Type |
---|
System.Windows.Thickness |
Mode
Gets or sets whether the annotation is currently being edited or not.
Declaration
public ContentEditorMode Mode { get; set; }
Property Value
Type |
---|
ContentEditorMode |
Offset
Gets or sets the fraction/ratio(relative to node) that Gets or sets the position of the Annotation.
Declaration
public Point Offset { get; set; }
Property Value
Type |
---|
System.Windows.Point |
Pivot
Gets or sets the annotation should be align based on pivot point.
Declaration
public Point Pivot { get; set; }
Property Value
Type |
---|
System.Windows.Point |
ReadOnly
Gets or sets a value indicates whether the annotation is editable.
Declaration
public bool ReadOnly { get; set; }
Property Value
Type |
---|
System.Boolean |
RotateAngle
Gets or sets how the annotation text needs to be rotated.
Declaration
public double RotateAngle { get; set; }
Property Value
Type |
---|
System.Double |
Remarks
Default RotateAngle value of LaneHeader's Annotation is 270 degrees. If we want to place the Annotation in the Horizontal direction, we have to set the RotateAngle of LaneHeader's Annotation as 360 degrees.
RotationReference
Gets or sets the drag state of annotation.
Declaration
public RotationReference RotationReference { get; set; }
Property Value
Type |
---|
RotationReference |
Text
Gets or sets the text of the annotation.
Declaration
public string Text { get; set; }
Property Value
Type |
---|
System.String |
TextDecorations
Gets or sets the TextDecorations of the Annotation.
Declaration
public TextDecorationCollection TextDecorations { get; set; }
Property Value
Type |
---|
System.Windows.TextDecorationCollection |
TextHorizontalAlignment
Gets or sets the horizontal alignment of the annotation's text.
Declaration
public TextAlignment TextHorizontalAlignment { get; set; }
Property Value
Type |
---|
System.Windows.TextAlignment |
TextTrimming
Gets or sets the texttrimming of the annotation.
Declaration
public TextTrimming TextTrimming { get; set; }
Property Value
Type |
---|
System.Windows.TextTrimming |
TextVerticalAlignment
Gets or sets the vertical alignment of the annotation's text.
Declaration
public VerticalAlignment TextVerticalAlignment { get; set; }
Property Value
Type |
---|
System.Windows.VerticalAlignment |
TextWrapping
Gets or sets the TextWrapping of the Annotation.
Declaration
public TextWrapping TextWrapping { get; set; }
Property Value
Type |
---|
System.Windows.TextWrapping |
UnitHeight
Gets or sets the height of the annotation.
Declaration
public double UnitHeight { get; set; }
Property Value
Type |
---|
System.Double |
UnitWidth
Gets or sets the width of the annotation.
Declaration
public double UnitWidth { get; set; }
Property Value
Type |
---|
System.Double |
VerticalAlignment
Gets or sets the vertical alignment characteristics applied to this element when it is composed within a parent element such as a node or connector.
Declaration
public VerticalAlignment VerticalAlignment { get; set; }
Property Value
Type |
---|
System.Windows.VerticalAlignment |
ViewTemplate
Gets or sets the data template used to display the annotation in viewmode.
Declaration
public DataTemplate ViewTemplate { get; set; }
Property Value
Type |
---|
System.Windows.DataTemplate |
WrapText
Gets or sets how the annotation text needs to be wrapped.
Declaration
public TextWrapping WrapText { get; set; }
Property Value
Type |
---|
System.Windows.TextWrapping |
Methods
OnPropertyChanged(String)
Invoked whenever the effective value of any dependency property on this FrameworkElement has been updated. The specific dependency property that changed is reported in the arguments parameter. Overrides OnPropertyChanged(name).
Declaration
protected virtual void OnPropertyChanged(string name)
Parameters
Type | Name | Description |
---|---|---|
System.String | name |
Events
PropertyChanged
Occurs when a property value changes.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type |
---|
System.ComponentModel.PropertyChangedEventHandler |