A fully-featured WPF wrapper control for Microsoft's Monaco editor (the code editor that powers VS Code), built on WebView2, provides configuration binding, common methods and events.
Recommended Windows apps https://iceskydev.github.io/AppDoc/
Monaco editor version v0.55.1
- Monaco option (DependencyProperty):
- Theme
- ModelLanguage
- ReadOnly
- Fontfamily
- FontSize
- MinimapEnabled
- TabSize
- WordWrap
- LineNumber
- LineHeight
- Folding
- StickyScroll
- Monaco method:
- GetLanguages
- GetText
- SetText
- GetPosition
- SetPosition
- GetSelection
- SetSelection
- Focus
- Format
- Clear
- Monaco event:
- ContentChanged
- CursorPositionChanged
- SelectionChanged
- EditorFocused
- EditorBlurred
- MouseDown
- MouseUp
- KeyDown
- KeyUp
- LanguageChanged
- ScrollChanged
Prerequisites
- .NET 6.0 or later
- Microsoft Edge WebView2 Runtime installed
- Visual Studio 2022 or later (recommended)
Basic Usage
<Window xmlns:editor="clr-namespace:WPFMonaco;assembly=WPFMonaco">
...
<editor:MonacoEditor Text="{Binding Text}"/>
...
</Window>dotnet add package WPFMonaco
Requirements
- Visual Studio 2022
- .NET 6.0 SDK or later
- WebView2 Runtime
Steps
- Clone the repository
- Open WPFMonaco.sln
- Build the solution
- Reference the output assembly in your project
- C# to config tool: A Windows application that converts C# entity classes into strings in four formats: Json, XML, YAML and TOML
- Josn Tools: A JSON text processing tool supports view, edit, and multiple conversion functions.

