Version

Splitting (xamSyntaxEditor)

Topic Overview

Purpose

This topic will help you understand the document splitting capability of the xamSyntaxEditor™ and how to customize it.

Required background

The following topics are prerequisites to understanding this topic:

Topic Purpose

In this topic, you will find information to help you better understand the xamSyntaxEditor’s functions.

This topic covers the text editing capabilities of the xamSyntaxEditor control from both the developer and user’s perspective.

Introduction

Splitting summary

The xamSyntaxEditor supports splitting of the editing area (either horizontally or vertically). When enabled, the user may use this feature for a visual comparison of two parts of the edited document and make changes to both of them. You can configure which splitting is available to the user (see the table below). In addition, there is a property, which can be used to determine the current splitting status of the xamSyntaxEditor’s editing area.

The screenshot below shows the xamSyntaxEditor’s split handles:

xamSyntaxEditor Splitting1.png

The screenshot below shows the xamSyntaxEditor split horizontally:

xamSyntaxEditor Splitting2.png

Control Configuration Summary

Control configuration summary chart

The following table lists the configurable aspects of the xamSyntaxEditor’s splitting capabilities.

Configurable aspect Details Properties

You can enable/disable what splitting is available to the user.

You can obtain/set the current splitting status and see if and how the user has split the editing area.

Note
Note

You can also use commands to enable/disable splitting types and to set split. Please refer to the Events and Commands topic for more information.

Enable/Disable Different Splitting Types

Overview

You can enable/disable what splitting is available to the user.

Property settings

The following table maps the desired configuration to property settings.

In order to: Use this property: And set it to:

Change which splitting option is available to the user

SplitOptions

Example

The screenshot below demonstrates how the xamSyntaxEditor looks as a result of implementing the following settings:

Property Value

SplitOptions

EditorDocumentViewSplitOptions.AllowVerticalSplitsOnly

xamSyntaxEditor Splitting3.png

Obtain/Set the Current Splitting Status

Overview

You can obtain and set the current splitting status and see if and how the user has split the editing area.

Property settings

The following table maps the desired configuration to property settings.

In order to: Use this property: And:

Obtain the current splitting

SplitStatus

Read its value

Set the current splitting

SplitStatus

Set it to a value of type EditorDocumentViewSplitStatus

Code

The following code example shows how to obtain the current split status:

In C#:

if (this.xamSyntaxEditor1.SplitStatus ==
    EditorDocumentViewSplitStatus.SplitHorizontally)
{
    // do something
}
else if (this.xamSyntaxEditor1.SplitStatus ==
    EditorDocumentViewSplitStatus.SplitVertically)
{
    // do something else
}

In Visual Basic:

If Me.xamSyntaxEditor1.SplitStatus = _
    EditorDocumentViewSplitStatus.SplitHorizontally Then
        ' do something
ElseIf Me.xamSyntaxEditor1.SplitStatus = _
    EditorDocumentViewSplitStatus.SplitVertically Then
        ' do something else
End If

The following code example shows how to set the current split to vertical:

In C#:

this.xamSyntaxEditor1.SplitStatus = EditorDocumentViewSplitStatus.SplitVertically;

In Visual Basic:

Me.xamSyntaxEditor1.SplitStatus = EditorDocumentViewSplitStatus.SplitVertically

Related Topics

The following topics provide additional information related to this topic.

Topic Purpose

This topic provides information on how to change the presention of the document’s content inside the xamSyntaxEditor .

This topic explains the current line highlighting feature.