Class SelectionParagraphFormat
Represents the SelectionParagraphFormat class.
Inheritance
Implements
Namespace: Syncfusion.Windows.Controls.RichTextBoxAdv
Assembly: Syncfusion.SfRichTextBoxAdv.WPF.dll
Syntax
public class SelectionParagraphFormat : Object, INotifyPropertyChanged
Properties
AfterSpacing
Gets or Sets the after spacing of the selected paragraphs.
Declaration
public double AfterSpacing { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The after spacing of the selected paragraphs. |
BeforeSpacing
Gets or Sets the before spacing of the selected paragraphs.
Declaration
public double BeforeSpacing { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The before spacing of the selected paragraphs. |
Bidi
Gets or sets the bidirectional property of selected paragraphs.
Declaration
public Nullable<bool> Bidi { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Boolean> | The bidirectional property of the selected paragraphs. |
FirstLineIndent
Gets or Sets the first line indent of the selected paragraphs.
Declaration
public double FirstLineIndent { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The first line indent of the selected paragraphs. |
LeftIndent
Gets or Sets the left indent of the selected paragraphs.
Declaration
public double LeftIndent { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The left indent of the selected paragraphs. |
LineSpacing
Gets or Sets the line spacing of the selected paragraphs.
Declaration
public double LineSpacing { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The line spacing of the selected paragraphs. |
LineSpacingType
Gets or Sets the LineSpacingType of the selected paragraphs.
Declaration
public Nullable<LineSpacingType> LineSpacingType { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<LineSpacingType> | The LineSpacingType of the selected paragraphs. |
ListLevelNumber
Gets or sets the list level number of the selected paragraphs.
Declaration
public int ListLevelNumber { get; set; }
Property Value
Type | Description |
---|---|
System.Int32 | The list level number of the selected paragraphs. |
RightIndent
Gets or Sets the right indent of the selected paragraphs.
Declaration
public double RightIndent { get; set; }
Property Value
Type | Description |
---|---|
System.Double | The right indent of the selected paragraphs. |
StyleName
Gets or sets the style name.
Declaration
public string StyleName { get; set; }
Property Value
Type |
---|
System.String |
TextAlignment
Gets or Sets the TextAlignment of the selected paragraphs.
Declaration
public Nullable<TextAlignment> TextAlignment { get; set; }
Property Value
Type | Description |
---|---|
System.Nullable<System.Windows.TextAlignment> | The TextAlignment of the selected paragraphs. |
Methods
GetList()
Gets the ListAdv applied for the selected paragraphs.
Declaration
public ListAdv GetList()
Returns
Type | Description |
---|---|
ListAdv | Returns the ListAdv instance, if same list is applied for the selected paragraphs. Otherwise returns null. |
Examples
The following code example demonstrates how to retrieves the list for selected paragraphs.
<RichTextBoxAdv:SfRichTextBoxAdv x:Name="richTextBoxAdv"/>
public void GetList()
{
// Retrieves the list applied for the selected paragraphs.
ListAdv listAdv = richTextBoxAdv.Selection.ParagraphFormat.GetList();
if (listAdv != null)
{
// Retrieves the first list level in the list
ListLevelAdv listLevelAdv = listAdv.AbstractList.Levels[0];
// Sets the list level pattern as upper case letters.
listLevelAdv.ListLevelPattern = ListLevelPattern.UpLetter;
// Modifies the number format for the list level.
listLevelAdv.NumberFormat = "Section.%1";
// Modifies the start at value for the list level.
listLevelAdv.StartAt = 1;
// Modifies the character format for the list level.
listLevelAdv.CharacterFormat.FontFamily = new FontFamily("Arial");
// Sets the list. This will modify the existing list.
richTextBoxAdv.Selection.ParagraphFormat.SetList(listAdv);
}
}
Public Sub GetList()
' Retrieves the list applied for the selected paragraphs.
ListAdv listAdv = richTextBoxAdv.Selection.ParagraphFormat.GetList()
If listAdv IsNot Nothing Then
' Retrieves the first list level in the list
Dim listLevelAdv As ListLevelAdv = listAdv.AbstractList.Levels(0)
' Sets the list level pattern as upper case letters.
listLevelAdv.ListLevelPattern = ListLevelPattern.UpLetter
' Modifies the number format for the list level.
listLevelAdv.NumberFormat = "Section.%1"
' Modifies the start at value for the list level.
listLevelAdv.StartAt = 1
' Modifies the character format for the list level.
listLevelAdv.CharacterFormat.FontFamily = New FontFamily("Arial")
' Sets the list. This will modify the existing list.
richTextBoxAdv.Selection.ParagraphFormat.SetList(listAdv)
End If
End Sub
SetList(ListAdv)
Sets the specified ListAdv for the selected paragraphs.
Declaration
public void SetList(ListAdv listAdv)
Parameters
Type | Name | Description |
---|---|---|
ListAdv | listAdv | The ListAdv to be applied for the selected paragraphs. |
Remarks
If the specifed ListAdv is null, then list will be cleared for the selected paragraphs. Else if the selected paragraph has list, then the existing ListAdv will get modified with the specified see cref="ListAdv"/>. Otherwise the specified ListAdv will be applied for the selected paragraphs.
Examples
The following code example demonstrates how to apply list for the selected paragraphs.
<RichTextBoxAdv:SfRichTextBoxAdv x:Name="richTextBoxAdv"/>
public void SetList()
{
// Initializes a new abstract list.
AbstractListAdv abstractListAdv = new AbstractListAdv(null);
abstractListAdv.AbstractListId = 4;
// Defines a new list level.
ListLevelAdv listLevel = new ListLevelAdv(abstractListAdv);
listLevel.ParagraphFormat.LeftIndent = 48d;
listLevel.ParagraphFormat.FirstLineIndent = 24d;
listLevel.FollowCharacter = FollowCharacterType.Tab;
listLevel.ListLevelPattern = ListLevelPattern.LowLetter;
listLevel.NumberFormat = "(%1.)";
listLevel.RestartLevel = 0;
listLevel.StartAt = 1;
// Adds list level to abstract list.
abstractListAdv.Levels.Add(listLevel);
// Creates a new list instance.
ListAdv listAdv = new ListAdv(null);
listAdv.AbstractList = abstractListAdv;
listAdv.AbstractListId = abstractListAdv.AbstractListId;
listAdv.ListId = 4;
// If the selected paragraph has list, then modifies the list.
// Else the list will be added to the document and applied for the selected paragraphs.
richTextBoxAdv.Selection.ParagraphFormat.SetList(listAdv);
}
Public Sub SetList()
' Initializes a new abstract list.
Dim abstractListAdv As New AbstractListAdv(Nothing)
abstractListAdv.AbstractListId = 4
' Defines a new list level.
Dim listLevel As New ListLevelAdv(abstractListAdv)
listLevel.ParagraphFormat.LeftIndent = 48d
listLevel.ParagraphFormat.FirstLineIndent = 24d
listLevel.FollowCharacter = FollowCharacterType.Tab
listLevel.ListLevelPattern = ListLevelPattern.LowLetter
listLevel.NumberFormat = "(%1.)"
listLevel.RestartLevel = 0
listLevel.StartAt = 1
' Adds list level to abstract list.
abstractListAdv.Levels.Add(listLevel)
' Creates a new list instance.
Dim listAdv As New ListAdv(Nothing)
listAdv.AbstractList = abstractListAdv
listAdv.AbstractListId = abstractListAdv.AbstractListId
listAdv.ListId = 4
' If the selected paragraph has list, then modifies the list.
' Else the list will be added to the document and applied for the selected paragraphs.
richTextBoxAdv.Selection.ParagraphFormat.SetList(listAdv)
End Sub
Events
PropertyChanged
Occurs when a property value changes.
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Type
Type |
---|
System.ComponentModel.PropertyChangedEventHandler |