Skip to content

Commit c640d6b

Browse files
committed
WPF Example - MenuHandler commands now fire reliably
- The MVVM Light RelayCommand keeps a WeakRef to the command action, for us this is anonymous, so we need to keep the target alive. - Updated MVVMLightLibs (required for keepTargetAlive)
1 parent f0d2995 commit c640d6b

File tree

3 files changed

+13
-13
lines changed

3 files changed

+13
-13
lines changed

CefSharp.Wpf.Example/CefSharp.Wpf.Example.csproj

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -74,26 +74,26 @@
7474
<StartupObject>CefSharp.Wpf.Example.Program</StartupObject>
7575
</PropertyGroup>
7676
<ItemGroup>
77-
<Reference Include="GalaSoft.MvvmLight">
78-
<HintPath>..\packages\MvvmLightLibs.5.1.1.0\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
77+
<Reference Include="CommonServiceLocator, Version=2.0.2.0, Culture=neutral, PublicKeyToken=489b6accfaf20ef0, processorArchitecture=MSIL">
78+
<HintPath>..\packages\CommonServiceLocator.2.0.2\lib\net45\CommonServiceLocator.dll</HintPath>
7979
</Reference>
80-
<Reference Include="GalaSoft.MvvmLight.Extras">
81-
<HintPath>..\packages\MvvmLightLibs.5.1.1.0\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
80+
<Reference Include="GalaSoft.MvvmLight, Version=5.4.1.0, Culture=neutral, PublicKeyToken=e7570ab207bcb616, processorArchitecture=MSIL">
81+
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.dll</HintPath>
8282
</Reference>
83-
<Reference Include="GalaSoft.MvvmLight.Platform">
84-
<HintPath>..\packages\MvvmLightLibs.5.1.1.0\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
83+
<Reference Include="GalaSoft.MvvmLight.Extras, Version=5.4.1.0, Culture=neutral, PublicKeyToken=669f0b5e8f868abf, processorArchitecture=MSIL">
84+
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Extras.dll</HintPath>
8585
</Reference>
86-
<Reference Include="Microsoft.CSharp" />
87-
<Reference Include="Microsoft.Practices.ServiceLocation">
88-
<HintPath>..\packages\CommonServiceLocator.1.3\lib\portable-net4+sl5+netcore45+wpa81+wp8\Microsoft.Practices.ServiceLocation.dll</HintPath>
86+
<Reference Include="GalaSoft.MvvmLight.Platform, Version=5.4.1.0, Culture=neutral, PublicKeyToken=5f873c45e98af8a1, processorArchitecture=MSIL">
87+
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\GalaSoft.MvvmLight.Platform.dll</HintPath>
8988
</Reference>
89+
<Reference Include="Microsoft.CSharp" />
9090
<Reference Include="System" />
9191
<Reference Include="System.Core">
9292
<RequiredTargetFramework>3.5</RequiredTargetFramework>
9393
</Reference>
9494
<Reference Include="System.Drawing" />
9595
<Reference Include="System.Windows.Interactivity, Version=4.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
96-
<HintPath>..\packages\MvvmLightLibs.5.1.1.0\lib\net45\System.Windows.Interactivity.dll</HintPath>
96+
<HintPath>..\packages\MvvmLightLibs.5.4.1.1\lib\net45\System.Windows.Interactivity.dll</HintPath>
9797
</Reference>
9898
<Reference Include="System.Xaml" />
9999
<Reference Include="WindowsBase" />

CefSharp.Wpf.Example/Handlers/MenuHandler.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -199,7 +199,7 @@ bool IContextMenuHandler.RunContextMenu(IWebBrowser chromiumWebBrowser, IBrowser
199199
break;
200200
}
201201
}
202-
})
202+
}, keepTargetAlive: true)
203203
});
204204
}
205205
webBrowser.ContextMenu = menu;

CefSharp.Wpf.Example/packages.config

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<packages>
33
<package id="cef.redist.x64" version="75.1.14" targetFramework="net462" />
44
<package id="cef.redist.x86" version="75.1.14" targetFramework="net462" />
5-
<package id="CommonServiceLocator" version="1.3" targetFramework="net45" />
5+
<package id="CommonServiceLocator" version="2.0.2" targetFramework="net462" />
66
<package id="Microsoft.Net.Compilers" version="2.9.0" targetFramework="net462" developmentDependency="true" />
7-
<package id="MvvmLightLibs" version="5.1.1.0" targetFramework="net45" />
7+
<package id="MvvmLightLibs" version="5.4.1.1" targetFramework="net462" />
88
</packages>

0 commit comments

Comments
 (0)