forked from cefsharp/CefSharp
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.xaml.cs
50 lines (40 loc) · 1.62 KB
/
App.xaml.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
// 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;
CefExample.Init(settings, browserProcessHandler: browserProcessHandler);
base.OnStartup(e);
}
}
}