Skip to content

Commit 1851926

Browse files
authored
Merge pull request #2 from DevExpress-Examples/main
Description added
2 parents ebcde12 + 425e24f commit 1851926

File tree

2 files changed

+43
-16
lines changed

2 files changed

+43
-16
lines changed

README.md

Lines changed: 43 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,28 +3,55 @@
33
[![](https://img.shields.io/badge/Open_in_DevExpress_Support_Center-FF7200?style=flat-square&logo=DevExpress&logoColor=white)](https://supportcenter.devexpress.com/ticket/details/T1223158)
44
[![](https://img.shields.io/badge/📖_How_to_use_DevExpress_Examples-e9f6fc?style=flat-square)](https://docs.devexpress.com/GeneralInformation/403183)
55
<!-- default badges end -->
6-
# DXHtmlEditor
76

8-
This is the repository template for creating new examples. Describe the solved task here.
7+
# Integrate JavaScript HTML Editor into a WinForms App
98

10-
Put a screenshot that illustrates the result here.
9+
This example integrates the JavaScript WYSIWYG HTML Editor (a components that ships as part of [DevExteme UI component suite](https://js.devexpress.com)) within a WinForms application. The client-side HTML Editor is embedded into the Microsoft Edge WebView2 control (`DXHtmlEditorWebView`).
1110

12-
Then, add implementation details (steps, code snippets, and other technical information in a free form), or add a link to an existing document with implementation details.
11+
![Integrate JavaScript HTML Editor into a WinForms Application](https://raw.githubusercontent.com/DevExpress-Examples/integrate-devextreme-javascript-html-editor-into-winforms-app/main/i/devextreme-html-editor-within-winforms-app.png?token=GHSAT0AAAAAACOLUA4BY24LLNXJFVZ63SBCZPYBT7Q)
1312

14-
## Files to Review
13+
## HTML Editor Features
14+
15+
- HTML and Markdown Support
16+
- HTML Editor features include:
17+
- Inline and Block Formats
18+
- Copy/Paste Rich Text Formatting
19+
- Insert Media and Upload Images
20+
- Tables
21+
- Mail Merge
22+
- UI Customization
23+
- Light/Dark Themes
24+
25+
> Note
26+
> - Using DevExpress JavaScript HTML Editor within your desktop application requires an active [DevExtreme license](https://www.devexpress.com/buy/js/).
27+
> - The DevExtreme HTML Editor does not support all HTML-related features and tags ([read about limitations](https://js.devexpress.com/Angular/Documentation/Guide/UI_Components/HtmlEditor/Overview/)).
1528
16-
- link.cs (VB: link.vb)
17-
- link.js
18-
- ...
29+
The example also implements the following:
1930

20-
## Documentation
31+
- Auto-syncs the WinForms application skin with the HTML Editor’s theme. When switching from a dark to a light color palette (and vice versa), the corresponding theme (dark or light) is applied to the HTML Editor.
32+
- Undo/Redo Ribbon commands allow users to revert or redo actions within the HTML Editor.
2133

22-
- link
23-
- link
24-
- ...
34+
## Use the HTML Editor in Your WinForms App
2535

26-
## More Examples
36+
1. Copy the `DXHtmlEditor` folder to your project.
37+
2. Install the `Microsoft.Web.WebView2` NuGet package.
38+
3. Open the *DXHtmlEditorClient.cs* file and specify the default namespace within the `OnWebResourceRequested` method:
39+
```csharp
40+
void OnWebResourceRequested(object sender, CoreWebView2WebResourceRequestedEventArgs e) {
41+
var environment = webView?.Environment;
42+
if(environment == null)
43+
return;
44+
string asset = $@"{nameof(MyDefaultNamespace)}.{nameof(DXHtmlEditor)}.Assets.{e.Request.Uri.Substring(rootURIFilter.Length - 1)}";
45+
// ...
46+
}
47+
```
48+
4. Set **Build Action** to "Embedded Resource" for all files in the Assets folder.
49+
5. Build the solution.
50+
6. Drop the `DXHtmlEditorWebView` component from the toolbox onto a form.
51+
52+
## Files to Review
2753

28-
- link
29-
- link
30-
- ...
54+
- [DXHtmlEditorClient.cs](./DXHtmlEditor/DXHtmlEditorClient.cs)
55+
- [DXHtmlEditorWebView.cs](./DXHtmlEditor/DXHtmlEditorWebView.cs)
56+
- [MainForm.cs](./MainForm.cs)
57+
- [index.js](./DXHtmlEditor/Assets/index.js)
49.5 KB
Loading

0 commit comments

Comments
 (0)