Files
cefsharp/CefSharp.Wpf.Example/App.xaml.cs
T
Alex Maitland 7af16b9571 Add IWindowInfo.RuntimeStyle
- CEF will remove the alloy bootstrap (likely in M127)
- Change examples to use the `Chrome Runtime`
-

Issue https://github.com/chromiumembedded/cef/issues/3685
2024-05-06 11:03:04 +10:00

52 lines
1.7 KiB
C#

// Copyright © 2011 The CefSharp Authors. All rights reserved.
//
// Use of this source code is governed by a BSD-style license that can be found in the LICENSE file.
using System.Windows;
using CefSharp.Example;
using CefSharp.Example.Handlers;
using CefSharp.Wpf.Example.Handlers;
namespace CefSharp.Wpf.Example
{
public partial class App : Application
{
protected override void OnStartup(StartupEventArgs e)
{
//System.AppContext.SetSwitch("Switch.System.Windows.Input.Stylus.DisableStylusAndTouchSupport", true);
System.AppContext.SetSwitch("Switch.System.Windows.Input.Stylus.EnablePointerSupport", true);
#if DEBUG
if (!System.Diagnostics.Debugger.IsAttached)
{
MessageBox.Show("When running this Example outside of Visual Studio " +
"please make sure you compile in `Release` mode.", "Warning");
}
#endif
const bool multiThreadedMessageLoop = true;
IBrowserProcessHandler browserProcessHandler;
if (multiThreadedMessageLoop)
{
browserProcessHandler = new BrowserProcessHandler();
}
else
{
browserProcessHandler = new WpfBrowserProcessHandler(Dispatcher);
}
var settings = new CefSettings();
settings.MultiThreadedMessageLoop = multiThreadedMessageLoop;
settings.ExternalMessagePump = !multiThreadedMessageLoop;
settings.ChromeRuntime = true;
CefExample.Init(settings, browserProcessHandler: browserProcessHandler);
base.OnStartup(e);
}
}
}