/syncfusion-wpf:syncfusion-wpf-syntax-editorfrom Syncfusion WPF Controls
Implement Syncfusion WPF Syntax Editor (EditControl) for code editors and advanced text editing applications. Use this when building syntax-highlighted code editors, IDE-like editors, or source code editing interfaces in WPF. Covers syntax highlighting, IntelliSense, find/replace, programming language support, and Visual Studio-style editing features.
Ships in Syncfusion WPF Controls. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Guide for implementing Syncfusion® WPF Syntax Editor (EditControl) — an advanced code and text editor control for creating IDE-like editing experiences with syntax highlighting, IntelliSense, find/replace, and comprehensive editing features for multiple programming languages.
Use this skill when you need to:
This skill covers the complete Syntax Editor implementation including basic setup, language configuration, editing features, customization, and advanced scenarios.
The Syntax Editor (EditControl) is a high-performance text and code editor control that provides:
EditControl
├── Editor Area - Main text editing surface
│ ├── Line Numbers (optional)
│ ├── Folding Indicators (optional)
│ └── Text Content with Syntax Highlighting
├── Context Menu - Right-click operations
├── Status Bar (optional) - Position and mode info
└── IntelliSense Popup - Auto-completion suggestions
📄 Read: references/getting-started.md
📄 Read: references/overview.md
📄 Read: references/file-operations.md
📄 Read: references/syntax-highlighting.md
📄 Read: references/supported-languages.md
📄 Read: references/custom-language-support.md
📄 Read: references/intellisense.md
📄 Read: references/editing-text.md
📄 Read: references/edit-commands.md
📄 Read: references/selection.md
📄 Read: references/find-and-replace.md
📄 Read: references/text-navigation.md
📄 Read: references/line-numbers.md
📄 Read: references/expand-collapse.md
📄 Read: references/context-menu.md
📄 Read: references/status-bar.md
📄 Read: references/customization.md
📄 Read: references/advanced-features.md
<Window x:Class="CodeEditorApp.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:syncfusion="http://schemas.syncfusion.com/wpf">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- Toolbar -->
<ToolBar Grid.Row="0">
<Button Content="Open" Click="OpenFile_Click"/>
<Button Content="Save" Click="SaveFile_Click"/>
<Separator/>
<ComboBox Name="languageComboBox"
SelectionChanged="Language_Changed"
Width="120">
<ComboBoxItem Content="C#" Tag="CSharp"/>
<ComboBoxItem Content="Visual Basic" Tag="VB"/>
<ComboBoxItem Content="XAML" Tag="XAML"/>
<ComboBoxItem Content="XML" Tag="XML"/>
</ComboBox>
</ToolBar>
<!-- Syntax Editor -->
<syncfusion:EditControl Name="editControl"
Grid.Row="1"
DocumentLanguage="CSharp"
ShowLineNumber="True"
EnableOutlining="True"
EnableIntellisense="True"
Background="White"
FontSize="12"
FontFamily="Consolas"/>
</Grid>
</Window>
using Syncfusion.Windows.Edit;
using Microsoft.Win32;
using System.IO;
using System.Windows;
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
// Set initial language
editControl.DocumentLanguage = Languages.CSharp;
languageComboBox.SelectedIndex = 0;
}
private void OpenFile_Click(object sender, RoutedEventArgs e)
{
OpenFileDialog dialog = new OpenFileDialog
{
Filter = "C# Files (*.cs)|*.cs|VB Files (*.vb)|*.vb|XAML Files (*.xaml)|*.xaml|All Files (*.*)|*.*"
};
if (dialog.ShowDialog() == true)
{
editControl.Load(dialog.FileName);
// Auto-detect language from extension
string ext = Path.GetExtension(dialog.FileName).ToLower();
switch (ext)
{
case ".cs":
editControl.DocumentLanguage = Languages.CSharp;
break;
case ".vb":
editControl.DocumentLanguage = Languages.VB;
break;
case ".xaml":
editControl.DocumentLanguage = Languages.XAML;
break;
case ".xml":
editControl.DocumentLanguage = Languages.XML;
break;
}
}
}
private void SaveFile_Click(object sender, RoutedEventArgs e)
{
SaveFileDialog dialog = new SaveFileDialog
{
Filter = "C# Files (*.cs)|*.cs|VB Files (*.vb)|*.vb|XAML Files (*.xaml)|*.xaml|All Files (*.*)|*.*"
};
if (dialog.ShowDialog() == true)
{
editControl.Save(dialog.FileName);
}
}
private void Language_Changed(object sender, SelectionChangedEventArgs e)
{
if (editControl == null) return;
var selected = (ComboBoxItem)languageComboBox.SelectedItem;
string language = selected.Tag.ToString();
switch (language)
{
case "CSharp":
editControl.DocumentLanguage = Languages.CSharp;
break;
case "VB":
editControl.DocumentLanguage = Languages.VB;
break;
case "XAML":
editControl.DocumentLanguage = Languages.XAML;
break;
case "XML":
editControl.DocumentLanguage = Languages.XML;
break;
}
}
}
// Load file with specific encoding
editControl.Load("path/to/file.cs", Encoding.UTF8);
// Save with encoding
editControl.Save("path/to/output.cs", Encoding.UTF8);
// Load from stream
using (FileStream stream = new FileStream("file.cs", FileMode.Open))
{
editControl.Load(stream, Encoding.UTF8);
}
// Save to stream
using (FileStream stream = new FileStream("output.cs", FileMode.Create))
{
editControl.Save(stream, Encoding.UTF8);
}
// Enable IntelliSense in Custom mode
editControl.EnableIntellisense = true;
editControl.IntellisenseMode = IntellisenseMode.Custom;
// Business object must implement IIntellisenseItem
public class MyIntellisenseItem : IIntellisenseItem
{
public ImageSource Icon { get; set; }
public string Text { get; set; }
public IEnumerable<IIntellisenseItem> NestedItems { get; set; }
}
// Build custom items collection and assign to IntellisenseCustomItemsSource
var customItems = new ObservableCollection<MyIntellisenseItem>
{
new MyIntellisenseItem { Text = "CustomMethod" },
new MyIntellisenseItem { Text = "CustomProperty" },
new MyIntellisenseItem { Text = "Console" }
};
editControl.IntellisenseCustomItemsSource = customItems;
// Handle IntelliSenseBoxOpening event to filter items at runtime
editControl.IntelliSenseBoxOpening += (s, e) =>
{
// e.ItemsSource contains current items; set e.Cancel = true to suppress popup
if (string.IsNullOrEmpty(editControl.Text))
e.Cancel = true;
};
// Simple find
FindResult result = editControl.FindText("SearchTerm",
FindOptions.MatchCase | FindOptions.WholeWord);
if (result != null)
{
Console.WriteLine($"Found at line {result.LineNumber}");
}
// Find with regex
FindResult regexResult = editControl.FindText(@"\d{3}-\d{4}",
FindOptions.UseRegularExpressions);
// Replace all occurrences
int replacedCount = editControl.ReplaceAll("oldText", "newText",
FindOptions.MatchCase);
// Replace with confirmation
while (editControl.FindNext("oldText", FindOptions.None))
{
var dialogResult = MessageBox.Show("Replace this occurrence?",
"Confirm", MessageBoxButton.YesNoCancel);
if (dialogResult == MessageBoxResult.Yes)
editControl.SelectedText = "newText";
else if (dialogResult == MessageBoxResult.Cancel)
break;
}
Define formats and lexems as XAML resources, then apply them to a class that inherits ProceduralLanguageBase:
<!-- Define formats in XAML Resources -->
<syncfusion:FormatsCollection x:Key="myLangFormats">
<syncfusion:EditFormats Foreground="Blue" FormatName="KeywordFormat"/>
<syncfusion:EditFormats Foreground="Green" FormatName="CommentFormat"/>
<syncfusion:EditFormats Foreground="Brown" FormatName="StringFormat"/>
</syncfusion:FormatsCollection>
<!-- Define lexems in XAML Resources -->
<syncfusion:LexemCollection x:Key="myLangLexems">
<syncfusion:Lexem StartText="function" LexemType="Keyword" FormatName="KeywordFormat" ContainsEndText="False" IsMultiline="False"/>
<syncfusion:Lexem StartText="if" LexemType="Keyword" FormatName="KeywordFormat" ContainsEndText="False" IsMultiline="False"/>
<syncfusion:Lexem StartText="while" LexemType="Keyword" FormatName="KeywordFormat" ContainsEndText="False" IsMultiline="False"/>
<syncfusion:Lexem StartText="//" EndText="\r\n" LexemType="Comment" FormatName="CommentFormat" ContainsEndText="True" IsMultiline="False"/>
<syncfusion:Lexem StartText=""" EndText=""" LexemType="Literals" FormatName="StringFormat" ContainsEndText="True" IsMultiline="False"/>
</syncfusion:LexemCollection>
// Create custom language class inheriting ProceduralLanguageBase
public class MyLanguage : ProceduralLanguageBase
{
public MyLanguage(EditControl control) : base(control)
{
Name = "MyLanguage";
FileExtension = "mylang";
ApplyColoring = true;
SupportsOutlining = false;
SupportsIntellisense = false;
TextForeground = Brushes.Black;
}
}
// Wire up resources and apply the custom language
EditControl editControl = new EditControl();
editControl.DocumentLanguage = Languages.Custom;
MyLanguage customLanguage = new MyLanguage(editControl);
customLanguage.Lexem = Application.Current.Resources["myLangLexems"] as LexemCollection;
customLanguage.Formats = Application.Current.Resources["myLangFormats"] as FormatsCollection;
editControl.CustomLanguage = customLanguage;
// Enable outlining
editControl.EnableOutlining = true;
// Collapse all regions
editControl.CollapseAll();
// Expand all regions
editControl.ExpandAll();
// Toggle specific region
editControl.ToggleOutlining(lineNumber);
// Programmatically add folding region
editControl.AddFoldingRegion(startLine, endLine, "Region Name");
// Handle outlining events
editControl.OutlineCollapsed += (s, e) =>
{
Console.WriteLine($"Collapsed region at line {e.StartLine}");
};
| Property | Type | Description |
|---|---|---|
| Text | string | Gets/sets the entire text content |
| DocumentLanguage | ILanguage | Current language for syntax highlighting |
| ShowLineNumber | bool | Shows/hides line numbers |
| EnableIntellisense | bool | Enables IntelliSense features |
| EnableOutlining | bool | Enables code folding |
| IsReadOnly | bool | Makes editor read-only |
| SingleLineMode | bool | Uses editor as single-line TextBox |
| Property | Type | Description |
|---|---|---|
| SelectedText | string | Gets/sets currently selected text |
| SelectionStart | int | Selection start position |
| SelectionLength | int | Length of selection |
| CurrentLine | int | Current cursor line number |
| CurrentColumn | int | Current cursor column position |
| Property | Type | Description |
|---|---|---|
| FontFamily | FontFamily | Editor font |
| FontSize | double | Editor font size |
| Background | Brush | Editor background |
| Foreground | Brush | Default text color |
| LineNumberForeground | Brush | Line number color |
| SelectionBrush | Brush | Selection background color |
| Property | Type | Description |
|---|---|---|
| AllowDragDrop | bool | Enables text drag-drop |
| WordWrap | bool | Enables word wrapping |
| TabSize | int | Tab character width |
| UseSpacesInsteadOfTabs | bool | Converts tabs to spaces |
| AutoIndent | bool | Automatic indentation |
| Event | Description |
|---|---|
| TextChanged | Fired when text content changes |
| SelectionChanged | Fired when selection changes |
| DocumentLanguageChanged | Fired when language changes |
| IntellisenseOpening | Fired before showing IntelliSense popup |
| OutlineCollapsed | Fired when outline region collapses |
| OutlineExpanded | Fired when outline region expands |
Build development environments with syntax highlighting, IntelliSense, and debugging integration.
Create editors for XML, JSON, YAML configuration files with validation and auto-completion.
Display and analyze log files with syntax highlighting for different log levels and patterns.
Build database query tools with SQL syntax highlighting and query execution.
Create scripting environments for PowerShell, Python, or custom scripting languages.
Implement markdown editors with live preview and syntax highlighting.
Build template editing tools for code generation or document templates.
Create learning applications with code highlighting and interactive examples.
Language Selection
DocumentLanguage based on file extensionPerformance
BeginUpdate()/EndUpdate() for bulk text operationsUser Experience
File Operations
Customization
Accessibility
DocumentLanguage is set correctlyEnableIntellisense is trueIntellisenseMode settingBeginUpdate()/EndUpdate() for batch operationsShowLineNumber is trueNext Steps: Navigate to specific reference documents based on your implementation needs. Start with getting-started.md for initial setup, then explore syntax highlighting, IntelliSense, and editing features as needed.
references/advanced-features.md (opens in a new tab)references/context-menu.md (opens in a new tab)references/custom-language-support.md (opens in a new tab)references/customization.md (opens in a new tab)references/edit-commands.md (opens in a new tab)references/editing-text.md (opens in a new tab)references/expand-collapse.md (opens in a new tab)references/file-operations.md (opens in a new tab)references/find-and-replace.md (opens in a new tab)references/getting-started.md (opens in a new tab)references/intellisense.md (opens in a new tab)references/line-numbers.md (opens in a new tab)references/overview.md (opens in a new tab)references/selection.md (opens in a new tab)references/status-bar.md (opens in a new tab)references/supported-languages.md (opens in a new tab)references/syntax-highlighting.md (opens in a new tab)references/text-navigation.md (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
96 skills in this plugin
/syncfusion-wpf-3d-chartComprehensive guide for implementing Syncfusion WPF 3D Charts (SfChart3D) control for 3D data visualization in Windows Presentation Foundation applications. Use this when working with 3D charts, 3D visualization, or depth axis configurations. This skill covers 3D series types (column, pie, bar), Manhattan charts, 3D rotation, X/Y/Z coordinate plotting, and depth axis configuration for WPF applications./syncfusion-wpf-accordionImplement Syncfusion WPF SfAccordion for collapsible and expandable panel layouts. Use this when working with accordion controls, expandable panels, or collapsible section navigation in WPF. Covers populating items declaratively or via data binding, selection modes (One/OneOrMore/ZeroOrOne/ZeroOrMore), programmatic selection, appearance customization (AccentBrush, HeaderTemplate, ContentTemplate), and theming with SfSkinManager./syncfusion-wpf-ai-assistviewImplement Syncfusion WPF SfAIAssistView for AI chat and conversational assistant interfaces. Use this when building AI assistant UIs, message threads with AI responses, or integrating OpenAI/SemanticKernel in WPF. Covers typing indicators, suggestions, input/response toolbars, stop-responding features, conversation history, input placeholder text, empty view templates, and PromptRequest events using Syncfusion.SfChat.Wpf.npx claudepluginhub syncfusion/boldcreate-plugins --plugin syncfusion-wpf