WPF - Use Microsoft.Xaml.Behaviors.Wpf

Migrate from System.Windows.Interactivity.WPF to Microsoft.Xaml.Behaviors.Wpf
This commit is contained in:
amaitland 2020-08-26 16:27:10 +10:00 committed by Alex Maitland
parent 4ce32a4778
commit 337b617b46
6 changed files with 13 additions and 17 deletions

View File

@ -1,7 +1,7 @@
using CefSharp.Wpf; using CefSharp.Wpf;
using System.Windows; using System.Windows;
using System.Windows.Interactivity;
using System; using System;
using Microsoft.Xaml.Behaviors;
namespace CefSharp.MinimalExample.Wpf.Behaviours namespace CefSharp.MinimalExample.Wpf.Behaviours
{ {

View File

@ -1,6 +1,6 @@
using System.Windows.Interactivity; using System.Windows.Controls;
using System.Windows.Controls;
using System.Windows.Input; using System.Windows.Input;
using Microsoft.Xaml.Behaviors;
namespace CefSharp.MinimalExample.Wpf.Behaviours namespace CefSharp.MinimalExample.Wpf.Behaviours
{ {

View File

@ -70,20 +70,16 @@
<ApplicationManifest>app.manifest</ApplicationManifest> <ApplicationManifest>app.manifest</ApplicationManifest>
</PropertyGroup> </PropertyGroup>
<ItemGroup> <ItemGroup>
<Reference Include="Microsoft.Expression.Interactions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL"> <Reference Include="Microsoft.Xaml.Behaviors, Version=1.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\packages\System.Windows.Interactivity.WPF.2.0.20525\lib\net40\Microsoft.Expression.Interactions.dll</HintPath> <HintPath>..\packages\Microsoft.Xaml.Behaviors.Wpf.1.1.19\lib\net45\Microsoft.Xaml.Behaviors.dll</HintPath>
<Private>True</Private>
</Reference> </Reference>
<Reference Include="System" /> <Reference Include="System" />
<Reference Include="System.Windows.Interactivity, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
<HintPath>..\packages\System.Windows.Interactivity.WPF.2.0.20525\lib\net40\System.Windows.Interactivity.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="Microsoft.CSharp" /> <Reference Include="Microsoft.CSharp" />
<Reference Include="System.Core" /> <Reference Include="System.Core" />
<Reference Include="System.Xaml"> <Reference Include="System.Xaml">
<RequiredTargetFramework>4.0</RequiredTargetFramework> <RequiredTargetFramework>4.0</RequiredTargetFramework>
</Reference> </Reference>
<Reference Include="System.XML" />
<Reference Include="WindowsBase" /> <Reference Include="WindowsBase" />
<Reference Include="PresentationCore" /> <Reference Include="PresentationCore" />
<Reference Include="PresentationFramework" /> <Reference Include="PresentationFramework" />

View File

@ -33,8 +33,8 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<PackageReference Include="System.Windows.Interactivity.WPF" Version="2.0.20525" />
<PackageReference Include="CefSharp.Wpf" Version="84.4.10" /> <PackageReference Include="CefSharp.Wpf" Version="84.4.10" />
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.19" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>

View File

@ -4,7 +4,7 @@
xmlns:wpf="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf" xmlns:wpf="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
xmlns:cef="clr-namespace:CefSharp;assembly=CefSharp.Core" xmlns:cef="clr-namespace:CefSharp;assembly=CefSharp.Core"
xmlns:behaviours="clr-namespace:CefSharp.MinimalExample.Wpf.Behaviours" xmlns:behaviours="clr-namespace:CefSharp.MinimalExample.Wpf.Behaviours"
xmlns:i="clr-namespace:System.Windows.Interactivity;assembly=System.Windows.Interactivity" xmlns:behaviors="http://schemas.microsoft.com/xaml/behaviors"
Title="{Binding Path=Title, ElementName=Browser, Converter={StaticResource TitleConverter}}" Title="{Binding Path=Title, ElementName=Browser, Converter={StaticResource TitleConverter}}"
WindowState="Maximized"> WindowState="Maximized">
<Grid> <Grid>
@ -32,9 +32,9 @@
<Button Content="Back" Command="{Binding WebBrowser.BackCommand, ElementName=Browser}" Width="50"/> <Button Content="Back" Command="{Binding WebBrowser.BackCommand, ElementName=Browser}" Width="50"/>
<Button Content="Forward" Command="{Binding WebBrowser.ForwardCommand, ElementName=Browser}" Grid.Column="1" Width="60"/> <Button Content="Forward" Command="{Binding WebBrowser.ForwardCommand, ElementName=Browser}" Grid.Column="1" Width="60"/>
<TextBox x:Name="txtBoxAddress" Text="{Binding Address, ElementName=Browser, FallbackValue=www.google.com}" Grid.Column="2" FontSize="12" BorderBrush="Gray" BorderThickness="1"> <TextBox x:Name="txtBoxAddress" Text="{Binding Address, ElementName=Browser, FallbackValue=www.google.com}" Grid.Column="2" FontSize="12" BorderBrush="Gray" BorderThickness="1">
<i:Interaction.Behaviors> <behaviors:Interaction.Behaviors>
<behaviours:TextBoxBindingUpdateOnEnterBehaviour /> <behaviours:TextBoxBindingUpdateOnEnterBehaviour />
</i:Interaction.Behaviors> </behaviors:Interaction.Behaviors>
</TextBox> </TextBox>
<Button Content="Print..." Command="{Binding WebBrowser.PrintCommand, ElementName=Browser}" Grid.Column="3" Width="50" /> <Button Content="Print..." Command="{Binding WebBrowser.PrintCommand, ElementName=Browser}" Grid.Column="3" Width="50" />
<Button Content="View source" Command="{Binding WebBrowser.ViewSourceCommand, ElementName=Browser}" Grid.Column="4" Width="75" /> <Button Content="View source" Command="{Binding WebBrowser.ViewSourceCommand, ElementName=Browser}" Grid.Column="4" Width="75" />
@ -42,9 +42,9 @@
<Border Grid.Row="1" BorderBrush="Gray" BorderThickness="0,1"> <Border Grid.Row="1" BorderBrush="Gray" BorderThickness="0,1">
<wpf:ChromiumWebBrowser x:Name="Browser" <wpf:ChromiumWebBrowser x:Name="Browser"
Address="www.google.com"> Address="www.google.com">
<i:Interaction.Behaviors> <behaviors:Interaction.Behaviors>
<behaviours:HoverLinkBehaviour x:Name="HoverLinkBehaviour"/> <behaviours:HoverLinkBehaviour x:Name="HoverLinkBehaviour"/>
</i:Interaction.Behaviors> </behaviors:Interaction.Behaviors>
</wpf:ChromiumWebBrowser> </wpf:ChromiumWebBrowser>
</Border> </Border>
<ProgressBar IsIndeterminate="{Binding IsLoading, ElementName=Browser}" <ProgressBar IsIndeterminate="{Binding IsLoading, ElementName=Browser}"

View File

@ -4,5 +4,5 @@
<package id="cef.redist.x86" version="84.4.1" targetFramework="net452" /> <package id="cef.redist.x86" version="84.4.1" targetFramework="net452" />
<package id="CefSharp.Common" version="84.4.10" targetFramework="net452" /> <package id="CefSharp.Common" version="84.4.10" targetFramework="net452" />
<package id="CefSharp.Wpf" version="84.4.10" targetFramework="net452" /> <package id="CefSharp.Wpf" version="84.4.10" targetFramework="net452" />
<package id="System.Windows.Interactivity.WPF" version="2.0.20525" targetFramework="net452" /> <package id="Microsoft.Xaml.Behaviors.Wpf" version="1.1.19" targetFramework="net452" />
</packages> </packages>