WinUIEdit.Uwp 0.0.3-prerelease

This is a prerelease version of WinUIEdit.Uwp.
dotnet add package WinUIEdit.Uwp --version 0.0.3-prerelease
NuGet\Install-Package WinUIEdit.Uwp -Version 0.0.3-prerelease
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="WinUIEdit.Uwp" Version="0.0.3-prerelease" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add WinUIEdit.Uwp --version 0.0.3-prerelease
#r "nuget: WinUIEdit.Uwp, 0.0.3-prerelease"
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
// Install WinUIEdit.Uwp as a Cake Addin
#addin nuget:?package=WinUIEdit.Uwp&version=0.0.3-prerelease&prerelease

// Install WinUIEdit.Uwp as a Cake Tool
#tool nuget:?package=WinUIEdit.Uwp&version=0.0.3-prerelease&prerelease

WinUIEdit

WinUI 3 NuGet version UWP NuGet version

This is an early work-in-progress code editor control for both UWP and WinUI 3. It is a port of the Scintilla editor component. It is written in C++ and works with C#, C++, and any other WinRT-compatible language.

[!NOTE] This control is currently not production ready. Breaking API changes are very likely at this stage.

Quick start

Install either the WinUIEdit NuGet package if using WinUI 3 or the WinUIEdit.Uwp NuGet package if using UWP (WinUI 2).

Add the namespace and code editor control to your page as shown below:

<Page
    xmlns:editor="using:WinUIEditor">
    <editor:CodeEditorControl x:Name="MyEditor" HighlightingLanguage="csharp" />
</Page>

Syntax highlighting is available through the HighlightingLanguage property. To control the editor, use the Editor property. For example, to set the editor text:

MyEditor.Editor.SetText("Vintage tee, brand new phone");

See the Scintilla documentation for complete remarks on all methods.

If using C++/WinRT, add #include <winrt/WinUIEditor.h> to your pch.h file.

Demo

You can download a demo from Microsoft Store here. Expect some occasional glitches and incomplete features.

<img alt="Mica Editor: replica of Windows 11 Notepad with WinUIEdit control using syntax highlighting, line numbers, and mica, demoing C++ sample code" src="https://user-images.githubusercontent.com/18747724/213900470-3c57b252-3488-40d1-b708-f392a30aab2f.png" width="500" />

Advanced usage

CodeEditorControl wraps EditorBaseControl and includes additional features and changes default settings and styles. EditorBaseControl can be used directly if only the original Scintilla control is desired. The Scintilla API is available through a WinRT wrapper exposed by the Editor property, as well as the original window message-based API via the SendMessage method.

Windows version support

The WinUI 3 version of this control should work on Windows 10, version 1809 and later and support ARM64, x64, and x86. The UWP version of this control should work on Windows 10, version 1703 and later. It will run on ARM64, ARM32, x64, and x86.

Development

How to build this project

To switch the build between WinUI 3 and UWP, you will need to modify UseWinUI3.txt to true or false. To do this quickly, use the WinUI3 and Uwp tools. Open WinUIEditor.sln in Visual Studio 2022. Then, set CsDemoUWP or CppDemoUWP as the startup project for UWP or CsDemoWinUI3 or CppDemoWinUI3 for WinUI 3. Now you can build and run the project.

Project file structure

Folder Description
WinUIEditor XAML control that hosts the Scintilla port (the C++ project in this folder is also responsible for compiling the scintilla folder code)
scintilla\winui Scintilla platform code for UWP/WinUI 3
scintilla Unmodified Scintilla source code with new winui subfolder
lexilla Lexilla source code (patches noted in WinUIModified.txt)
Tools Tools to keep the Scintilla code up-to-date and aid in development (see Tools\README)
Product Compatible and additional computed target framework versions.
.NET net5.0 was computed.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.0-windows was computed. 
.NET Core netcoreapp3.0 is compatible.  netcoreapp3.1 was computed. 
.NET Framework net46 is compatible.  net461 was computed.  net462 was computed.  net463 was computed.  net47 was computed.  net471 was computed.  net472 was computed.  net48 was computed.  net481 was computed. 
native native is compatible. 
Universal Windows Platform uap was computed.  uap10.0 is compatible. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .NETCoreApp 3.0

    • No dependencies.
  • .NETFramework 4.6

    • No dependencies.
  • UAP 10.0

    • No dependencies.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last updated
0.0.3-prerelease 154 3/4/2024
0.0.2-prerelease 67 1/23/2024
0.0.1-prerelease 50 1/22/2024