Files
cefsharp/CefSharp.Wpf.Example/App.xaml.cs
T
amaitland 8a3685d320 Add WpfBrowserProcessHandler example implementation - not ready for production use.
Better integration with message loop does appear to have some benefits with context menus etc
2016-09-07 13:54:28 +10:00

43 lines
1.3 KiB
C#

// Copyright © 2010-2016 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.Threading.Tasks;
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)
{
#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);
}
CefExample.Init(osr: true, multiThreadedMessageLoop: multiThreadedMessageLoop, browserProcessHandler: browserProcessHandler);
base.OnStartup(e);
}
}
}