Coder Social home page Coder Social logo

devexpress-examples / integrate-devextreme-javascript-html-editor-into-winforms-app Goto Github PK

View Code? Open in Web Editor NEW
1.0 32.0 1.0 134 KB

Integrate the JavaScript WYSIWYG HTML Editor within a Windows Forms app.

License: Other

HTML 5.21% JavaScript 14.22% C# 80.57%
devexpress dotnet export-html htmleditor hybrid-app javascript visual-studio webview2 winforms edit-html

integrate-devextreme-javascript-html-editor-into-winforms-app's Introduction

Integrate JavaScript HTML Editor into a WinForms App

This example integrates the JavaScript WYSIWYG HTML Editor (a components that ships as part of DevExteme UI component suite) within a WinForms application. The client-side HTML Editor is embedded into the Microsoft Edge WebView2 control (DXHtmlEditorWebView).

Integrate JavaScript HTML Editor into a WinForms Application

HTML Editor Features

  • HTML and Markdown Support
  • HTML Editor features include:
  • Inline and Block Formats
  • Copy/Paste Rich Text Formatting
  • Insert Media and Upload Images
  • Tables
  • Mail Merge
  • UI Customization
  • Light/Dark Themes

NOTE

  • Using DevExpress JavaScript HTML Editor within your desktop application requires an active DevExtreme license.
  • The DevExtreme HTML Editor does not support all HTML-related features and tags (read about limitations).

The example also implements the following:

  • 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.
  • Undo/Redo Ribbon commands allow users to revert or redo actions within the HTML Editor.

Use the HTML Editor in Your WinForms App

  1. Copy the DXHtmlEditor folder to your project.
  2. Install the Microsoft.Web.WebView2 NuGet package.
  3. Open the DXHtmlEditorClient.cs file and specify the default namespace within the OnWebResourceRequested method:
    void OnWebResourceRequested(object sender, CoreWebView2WebResourceRequestedEventArgs e) {
     var environment = webView?.Environment;
     if(environment == null)
         return;
     string asset = $@"{nameof(MyDefaultNamespace)}.{nameof(DXHtmlEditor)}.Assets.{e.Request.Uri.Substring(rootURIFilter.Length - 1)}";
     // ...
    }
  4. Set Build Action to "Embedded Resource" for all files in the Assets folder.
  5. Build the solution.
  6. Drop the DXHtmlEditorWebView component from the toolbox onto a form.

Files to Review

See Also

Integrate the DevExtreme JavaScript HTML Editor into a WinForms Application (Blog Post)

integrate-devextreme-javascript-html-editor-into-winforms-app's People

Contributors

andreyslabov avatar friedcucumber avatar iam0k avatar

Stargazers

 avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

parmidasoftdev

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.