diff --git a/CefSharp.MinimalExample.Wpf/App.xaml.cs b/CefSharp.MinimalExample.Wpf/App.xaml.cs index 1668715..a516982 100644 --- a/CefSharp.MinimalExample.Wpf/App.xaml.cs +++ b/CefSharp.MinimalExample.Wpf/App.xaml.cs @@ -40,5 +40,17 @@ namespace CefSharp.MinimalExample.Wpf Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null); } } + + public static void RunUIThread(Action action) + { + if (Current.CheckAccess()) + { + action?.Invoke(); + } + else + { + Current.Dispatcher.BeginInvoke(action); + } + } } } diff --git a/CefSharp.MinimalExample.Wpf/CefSharp.MinimalExample.Wpf.csproj b/CefSharp.MinimalExample.Wpf/CefSharp.MinimalExample.Wpf.csproj index e389f60..c5fa7e3 100644 --- a/CefSharp.MinimalExample.Wpf/CefSharp.MinimalExample.Wpf.csproj +++ b/CefSharp.MinimalExample.Wpf/CefSharp.MinimalExample.Wpf.csproj @@ -103,12 +103,17 @@ ..\packages\CefSharp.Wpf.107.1.120\lib\net452\CefSharp.Wpf.dll True + + ..\packages\log4net.2.0.15\lib\net45\log4net.dll + ..\packages\Microsoft.Xaml.Behaviors.Wpf.1.1.19\lib\net45\Microsoft.Xaml.Behaviors.dll + + 4.0 diff --git a/CefSharp.MinimalExample.Wpf/MainWindow.xaml b/CefSharp.MinimalExample.Wpf/MainWindow.xaml index e0d7b2c..cc63a66 100644 --- a/CefSharp.MinimalExample.Wpf/MainWindow.xaml +++ b/CefSharp.MinimalExample.Wpf/MainWindow.xaml @@ -1,13 +1,13 @@  + xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" + xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" + xmlns:wpf="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf" + xmlns:cef="clr-namespace:CefSharp;assembly=CefSharp.Core" + xmlns:behaviours="clr-namespace:CefSharp.MinimalExample.Wpf.Behaviours" + xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors" + Title="{Binding Path=Title, ElementName=Browser, Converter={StaticResource TitleConverter}}" + FocusManager.FocusedElement="{Binding ElementName=Browser}" + WindowState="Maximized"> @@ -23,6 +23,10 @@ + + + + @@ -30,32 +34,52 @@ -