diff --git a/CefSharp.Example/CefSharp.Example.csproj b/CefSharp.Example/CefSharp.Example.csproj index 1d6ee49eb6..f19986813f 100644 --- a/CefSharp.Example/CefSharp.Example.csproj +++ b/CefSharp.Example/CefSharp.Example.csproj @@ -75,6 +75,12 @@ prompt AllRules.ruleset + + true + + + ..\CefSharp.snk + diff --git a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj index 63fe18a9a8..eaf51210f2 100644 --- a/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj +++ b/CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj @@ -79,6 +79,12 @@ prompt AllRules.ruleset + + true + + + ..\CefSharp.snk + @@ -96,8 +102,6 @@ MSBuild:Compile Designer - - MainView.xaml diff --git a/CefSharp.Wpf.Example/Mvvm/DelegateCommand.cs b/CefSharp.Wpf.Example/Mvvm/DelegateCommand.cs deleted file mode 100644 index 23d9fc6caa..0000000000 --- a/CefSharp.Wpf.Example/Mvvm/DelegateCommand.cs +++ /dev/null @@ -1,31 +0,0 @@ -using System; -using System.Windows.Input; - -namespace CefSharp.Wpf.Example.Mvvm -{ - public class DelegateCommand : ICommand - { - private readonly Action commandHandler; - private readonly Func canExecuteHandler; - - public DelegateCommand(Action commandHandler, Func canExecuteHandler = null) - { - this.commandHandler = commandHandler; - this.canExecuteHandler = canExecuteHandler; - } - - public void Execute(object parameter) - { - commandHandler(); - } - - public bool CanExecute(object parameter) - { - return - canExecuteHandler == null || - canExecuteHandler(); - } - - public event EventHandler CanExecuteChanged; - } -} diff --git a/CefSharp.Wpf.Example/Views/Main/MainViewModel.cs b/CefSharp.Wpf.Example/Views/Main/MainViewModel.cs index aecf0b65af..ce0949f4e3 100644 --- a/CefSharp.Wpf.Example/Views/Main/MainViewModel.cs +++ b/CefSharp.Wpf.Example/Views/Main/MainViewModel.cs @@ -1,5 +1,4 @@ using CefSharp.Example; -using CefSharp.Wpf.Example.Mvvm; using System; using System.ComponentModel; using System.Windows; @@ -59,11 +58,11 @@ public bool ShowSidebar set { PropertyChanged.ChangeAndNotify(ref showSidebar, value, () => ShowSidebar); } } - public DelegateCommand GoCommand { get; set; } - public DelegateCommand ViewSourceCommand { get; set; } - public DelegateCommand HomeCommand { get; set; } - public DelegateCommand ExecuteJavaScriptCommand { get; set; } - public DelegateCommand EvaluateJavaScriptCommand { get; set; } + public ICommand GoCommand { get; set; } + public ICommand ViewSourceCommand { get; set; } + public ICommand HomeCommand { get; set; } + public ICommand ExecuteJavaScriptCommand { get; set; } + public ICommand EvaluateJavaScriptCommand { get; set; } public event PropertyChangedEventHandler PropertyChanged; diff --git a/CefSharp.Wpf/CefSharp.Wpf.csproj b/CefSharp.Wpf/CefSharp.Wpf.csproj index 6dfed5d3ce..fd13e2bdbb 100644 --- a/CefSharp.Wpf/CefSharp.Wpf.csproj +++ b/CefSharp.Wpf/CefSharp.Wpf.csproj @@ -90,6 +90,7 @@ + Code diff --git a/CefSharp.Wpf/DelegateCommand.cs b/CefSharp.Wpf/DelegateCommand.cs index 208d81f39a..9e37f2f911 100644 --- a/CefSharp.Wpf/DelegateCommand.cs +++ b/CefSharp.Wpf/DelegateCommand.cs @@ -1,7 +1,6 @@ using System; using System.Windows; using System.Windows.Input; -using System.Windows.Threading; namespace CefSharp.Wpf { diff --git a/CefSharp.Wpf.Example/Mvvm/DelegateCommandT.cs b/CefSharp.Wpf/DelegateCommandT.cs similarity index 89% rename from CefSharp.Wpf.Example/Mvvm/DelegateCommandT.cs rename to CefSharp.Wpf/DelegateCommandT.cs index f76ad483e8..5f7c458952 100644 --- a/CefSharp.Wpf.Example/Mvvm/DelegateCommandT.cs +++ b/CefSharp.Wpf/DelegateCommandT.cs @@ -1,9 +1,9 @@ using System; using System.Windows.Input; -namespace CefSharp.Wpf.Example.Mvvm +namespace CefSharp.Wpf { - public class DelegateCommand : ICommand + internal class DelegateCommand : ICommand { private readonly Action commandHandler; private readonly Func canExecuteHandler; diff --git a/CefSharp.Wpf/Properties/AssemblyInfo.cs b/CefSharp.Wpf/Properties/AssemblyInfo.cs index 206d0c1039..c38696da34 100644 --- a/CefSharp.Wpf/Properties/AssemblyInfo.cs +++ b/CefSharp.Wpf/Properties/AssemblyInfo.cs @@ -1,4 +1,5 @@ -using CefSharp; +using System.Runtime.CompilerServices; +using CefSharp; using System.Reflection; using System.Runtime.InteropServices; using System.Windows; @@ -20,3 +21,5 @@ ResourceDictionaryLocation.None, ResourceDictionaryLocation.SourceAssembly )] + +[assembly: InternalsVisibleTo(AssemblyInfo.CefSharpWpfExampleProject)] diff --git a/CefSharp/Properties/AssemblyInfo.cs b/CefSharp/Properties/AssemblyInfo.cs index 5eff7a6585..bbef3f4d19 100644 --- a/CefSharp/Properties/AssemblyInfo.cs +++ b/CefSharp/Properties/AssemblyInfo.cs @@ -38,6 +38,7 @@ public static class AssemblyInfo public const string CefSharpCoreProject = "CefSharp.Core, PublicKey=" + PublicKey; public const string CefSharpBrowserSubprocessProject = "CefSharp.BrowserSubprocess, PublicKey=" + PublicKey; public const string CefSharpWpfProject = "CefSharp.Wpf, PublicKey=" + PublicKey; + public const string CefSharpWpfExampleProject = "CefSharp.Wpf.Example, PublicKey=" + PublicKey; public const string CefSharpWinFormsProject = "CefSharp.WinForms, PublicKey=" + PublicKey; public const string CefSharpTestProject = "CefSharp.Test, PublicKey=" + PublicKey;