Skip to content
This repository has been archived by the owner on Jan 15, 2023. It is now read-only.

Chromely CefSharp Usages

mattkol edited this page Aug 23, 2020 · 2 revisions

Chromely CefSharp Usages

Getting Started

When creating a new project, you want to create a .NET Framework/.NET Core 3/.NET 5 WinForms project.

Visual Studio 2019, JetBrains Rider or Visual Studio Code is preferred but any Editor can be used.

A simple Chromely CefSharp project requires:

class Program
{
   [STAThread]
   static void Main(string[] args)
   {
       AppBuilder
       .Create()
       .UseApp<DemoChromelyApp>()
       .Build()
       .Run(args);
    }
}

Chromely CefSharp is configurable and extensible.

To run a Chromely CefSharp app, 3 primary objects can be configured.

Full application builder options:

class Program
{
   [STAThread]
   static void Main(string[] args)
   {
      AppBuilder
      .Create()
      .UseConfig<CustomConfiguraton>()
      .UseWindow<CustomWindow>()
      .UseApp<CustomChromelyApp>()
      .Build()
      .Run(args);
   }
}
class Program
{
   [STAThread]
   static void Main(string[] args)
   {
      AppBuilder
      .Create()
      .UseConfig<CustomConfiguraton>(new CustomConfiguraton())
      .UseWindow<CustomWindow>(new CustomWindow())
      .UseApp<CustomChromelyApp>(new CustomChromelyApp())
      .Build()
      .Run(args);
   }
}

Custom Application Class - required

To create a Chromely CefSharp application, a custom application class (and/or instance) is required. The class can inherit from any of the abstract class implementations:

Configuration Class - optional

To create Chromely CefSharp application, the Configuration class is not required. A custom configuration class must implement - IChromelyConfiguration. If a custom configuration class is not provided, it uses the default - DefaultConfiguration. Alternatively one can be configured using Configuration Section of appsettings.json parsed with Microsoft.Extensions.Configuration.Json.

Window Class - optional

A custom Window class, inherited from Window can be configured. If a custom configuration class is not provided, it uses the default - Window

Configuring

Coming soon!

Loading Html

Coming soon!

Resource Handling

Coming soon!

JavaScript Binding

Coming soon!

Register Ajax/XHR Handlers

Coming soon!

JavaScript Execution

Coming soon!

Scheme Registration

Coming soon!

Scheme Handlers

Coming soon!

Custom Http Handlers

Coming soon!

How to use commands

Coming soon!

Custom CEF Handlers

Coming soon!

How to use app settings

Coming soon!

Using DevTools

Coming soon!