Compare commits
5 Commits
d1e41f010d
...
dd7a518ea6
Author | SHA1 | Date | |
---|---|---|---|
|
dd7a518ea6 | ||
|
8e51e97a3d | ||
|
251567b311 | ||
|
4673654526 | ||
|
07f1f66b40 |
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\CefSharp.Common.106.0.260\build\CefSharp.Common.props" Condition="Exists('..\packages\CefSharp.Common.106.0.260\build\CefSharp.Common.props')" />
|
||||
<Import Project="..\packages\cef.redist.x86.106.0.26\build\cef.redist.x86.props" Condition="Exists('..\packages\cef.redist.x86.106.0.26\build\cef.redist.x86.props')" />
|
||||
<Import Project="..\packages\cef.redist.x64.106.0.26\build\cef.redist.x64.props" Condition="Exists('..\packages\cef.redist.x64.106.0.26\build\cef.redist.x64.props')" />
|
||||
<Import Project="..\packages\CefSharp.Common.107.1.120\build\CefSharp.Common.props" Condition="Exists('..\packages\CefSharp.Common.107.1.120\build\CefSharp.Common.props')" />
|
||||
<Import Project="..\packages\cef.redist.x86.107.1.12\build\cef.redist.x86.props" Condition="Exists('..\packages\cef.redist.x86.107.1.12\build\cef.redist.x86.props')" />
|
||||
<Import Project="..\packages\cef.redist.x64.107.1.12\build\cef.redist.x64.props" Condition="Exists('..\packages\cef.redist.x64.107.1.12\build\cef.redist.x64.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@ -88,16 +88,16 @@
|
||||
<StartupObject>CefSharp.MinimalExample.OffScreen.Program</StartupObject>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="CefSharp, Version=106.0.260.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138">
|
||||
<HintPath>..\packages\CefSharp.Common.106.0.260\lib\net452\CefSharp.dll</HintPath>
|
||||
<Reference Include="CefSharp, Version=107.1.120.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138">
|
||||
<HintPath>..\packages\CefSharp.Common.107.1.120\lib\net452\CefSharp.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="CefSharp.Core, Version=106.0.260.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138">
|
||||
<HintPath>..\packages\CefSharp.Common.106.0.260\lib\net452\CefSharp.Core.dll</HintPath>
|
||||
<Reference Include="CefSharp.Core, Version=107.1.120.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138">
|
||||
<HintPath>..\packages\CefSharp.Common.107.1.120\lib\net452\CefSharp.Core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="CefSharp.OffScreen, Version=106.0.260.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138">
|
||||
<HintPath>..\packages\CefSharp.OffScreen.106.0.260\lib\net452\CefSharp.OffScreen.dll</HintPath>
|
||||
<Reference Include="CefSharp.OffScreen, Version=107.1.120.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138">
|
||||
<HintPath>..\packages\CefSharp.OffScreen.107.1.120\lib\net452\CefSharp.OffScreen.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
@ -123,5 +123,5 @@
|
||||
<Target Name="CefSharpAfterBuildDebug" AfterTargets="AfterBuild">
|
||||
<CallTarget Targets="CefSharpAfterBuildDiagnostic" />
|
||||
</Target>
|
||||
<Import Project="..\packages\CefSharp.Common.106.0.260\build\CefSharp.Common.targets" Condition="Exists('..\packages\CefSharp.Common.106.0.260\build\CefSharp.Common.targets')" />
|
||||
<Import Project="..\packages\CefSharp.Common.107.1.120\build\CefSharp.Common.targets" Condition="Exists('..\packages\CefSharp.Common.107.1.120\build\CefSharp.Common.targets')" />
|
||||
</Project>
|
@ -62,7 +62,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CefSharp.OffScreen.NetCore" Version="106.0.260" />
|
||||
<PackageReference Include="CefSharp.OffScreen.NetCore" Version="107.1.120" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="cef.redist.x64" version="106.0.26" targetFramework="net452" />
|
||||
<package id="cef.redist.x86" version="106.0.26" targetFramework="net452" />
|
||||
<package id="CefSharp.Common" version="106.0.260" targetFramework="net452" />
|
||||
<package id="CefSharp.OffScreen" version="106.0.260" targetFramework="net452" />
|
||||
<package id="cef.redist.x64" version="107.1.12" targetFramework="net452" />
|
||||
<package id="cef.redist.x86" version="107.1.12" targetFramework="net452" />
|
||||
<package id="CefSharp.Common" version="107.1.120" targetFramework="net452" />
|
||||
<package id="CefSharp.OffScreen" version="107.1.120" targetFramework="net452" />
|
||||
</packages>
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\CefSharp.Common.106.0.260\build\CefSharp.Common.props" Condition="Exists('..\packages\CefSharp.Common.106.0.260\build\CefSharp.Common.props')" />
|
||||
<Import Project="..\packages\cef.redist.x86.106.0.26\build\cef.redist.x86.props" Condition="Exists('..\packages\cef.redist.x86.106.0.26\build\cef.redist.x86.props')" />
|
||||
<Import Project="..\packages\cef.redist.x64.106.0.26\build\cef.redist.x64.props" Condition="Exists('..\packages\cef.redist.x64.106.0.26\build\cef.redist.x64.props')" />
|
||||
<Import Project="..\packages\CefSharp.Common.107.1.120\build\CefSharp.Common.props" Condition="Exists('..\packages\CefSharp.Common.107.1.120\build\CefSharp.Common.props')" />
|
||||
<Import Project="..\packages\cef.redist.x86.107.1.12\build\cef.redist.x86.props" Condition="Exists('..\packages\cef.redist.x86.107.1.12\build\cef.redist.x86.props')" />
|
||||
<Import Project="..\packages\cef.redist.x64.107.1.12\build\cef.redist.x64.props" Condition="Exists('..\packages\cef.redist.x64.107.1.12\build\cef.redist.x64.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
@ -72,16 +72,16 @@
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="CefSharp, Version=106.0.260.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138">
|
||||
<HintPath>..\packages\CefSharp.Common.106.0.260\lib\net452\CefSharp.dll</HintPath>
|
||||
<Reference Include="CefSharp, Version=107.1.120.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138">
|
||||
<HintPath>..\packages\CefSharp.Common.107.1.120\lib\net452\CefSharp.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="CefSharp.Core, Version=106.0.260.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138">
|
||||
<HintPath>..\packages\CefSharp.Common.106.0.260\lib\net452\CefSharp.Core.dll</HintPath>
|
||||
<Reference Include="CefSharp.Core, Version=107.1.120.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138">
|
||||
<HintPath>..\packages\CefSharp.Common.107.1.120\lib\net452\CefSharp.Core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="CefSharp.WinForms, Version=106.0.260.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138">
|
||||
<HintPath>..\packages\CefSharp.WinForms.106.0.260\lib\net452\CefSharp.WinForms.dll</HintPath>
|
||||
<Reference Include="CefSharp.WinForms, Version=107.1.120.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138">
|
||||
<HintPath>..\packages\CefSharp.WinForms.107.1.120\lib\net452\CefSharp.WinForms.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
@ -144,5 +144,5 @@
|
||||
<Target Name="CefSharpAfterBuildDebug" AfterTargets="AfterBuild">
|
||||
<CallTarget Targets="CefSharpAfterBuildDiagnostic" />
|
||||
</Target>
|
||||
<Import Project="..\packages\CefSharp.Common.106.0.260\build\CefSharp.Common.targets" Condition="Exists('..\packages\CefSharp.Common.106.0.260\build\CefSharp.Common.targets')" />
|
||||
<Import Project="..\packages\CefSharp.Common.107.1.120\build\CefSharp.Common.targets" Condition="Exists('..\packages\CefSharp.Common.107.1.120\build\CefSharp.Common.targets')" />
|
||||
</Project>
|
@ -47,7 +47,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CefSharp.WinForms" Version="106.0.260" />
|
||||
<PackageReference Include="CefSharp.WinForms" Version="107.1.120" />
|
||||
</ItemGroup>
|
||||
|
||||
<Import Project="Sdk.targets" Sdk="Microsoft.NET.Sdk.WindowsDesktop" />
|
||||
|
@ -78,7 +78,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CefSharp.WinForms.NetCore" Version="106.0.260" />
|
||||
<PackageReference Include="CefSharp.WinForms.NetCore" Version="107.1.120" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
|
@ -1,7 +1,7 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="cef.redist.x64" version="106.0.26" targetFramework="net452" />
|
||||
<package id="cef.redist.x86" version="106.0.26" targetFramework="net452" />
|
||||
<package id="CefSharp.Common" version="106.0.260" targetFramework="net452" />
|
||||
<package id="CefSharp.WinForms" version="106.0.260" targetFramework="net452" />
|
||||
<package id="cef.redist.x64" version="107.1.12" targetFramework="net452" />
|
||||
<package id="cef.redist.x86" version="107.1.12" targetFramework="net452" />
|
||||
<package id="CefSharp.Common" version="107.1.120" targetFramework="net452" />
|
||||
<package id="CefSharp.WinForms" version="107.1.120" targetFramework="net452" />
|
||||
</packages>
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,8 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\packages\CefSharp.Common.106.0.260\build\CefSharp.Common.props" Condition="Exists('..\packages\CefSharp.Common.106.0.260\build\CefSharp.Common.props')" />
|
||||
<Import Project="..\packages\cef.redist.x86.106.0.26\build\cef.redist.x86.props" Condition="Exists('..\packages\cef.redist.x86.106.0.26\build\cef.redist.x86.props')" />
|
||||
<Import Project="..\packages\cef.redist.x64.106.0.26\build\cef.redist.x64.props" Condition="Exists('..\packages\cef.redist.x64.106.0.26\build\cef.redist.x64.props')" />
|
||||
<Import Project="..\packages\CefSharp.Common.107.1.120\build\CefSharp.Common.props" Condition="Exists('..\packages\CefSharp.Common.107.1.120\build\CefSharp.Common.props')" />
|
||||
<Import Project="..\packages\cef.redist.x86.107.1.12\build\cef.redist.x86.props" Condition="Exists('..\packages\cef.redist.x86.107.1.12\build\cef.redist.x86.props')" />
|
||||
<Import Project="..\packages\cef.redist.x64.107.1.12\build\cef.redist.x64.props" Condition="Exists('..\packages\cef.redist.x64.107.1.12\build\cef.redist.x64.props')" />
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
@ -91,24 +91,29 @@
|
||||
<ApplicationManifest>app.manifest</ApplicationManifest>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="CefSharp, Version=106.0.260.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138">
|
||||
<HintPath>..\packages\CefSharp.Common.106.0.260\lib\net452\CefSharp.dll</HintPath>
|
||||
<Reference Include="CefSharp, Version=107.1.120.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138">
|
||||
<HintPath>..\packages\CefSharp.Common.107.1.120\lib\net452\CefSharp.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="CefSharp.Core, Version=106.0.260.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138">
|
||||
<HintPath>..\packages\CefSharp.Common.106.0.260\lib\net452\CefSharp.Core.dll</HintPath>
|
||||
<Reference Include="CefSharp.Core, Version=107.1.120.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138">
|
||||
<HintPath>..\packages\CefSharp.Common.107.1.120\lib\net452\CefSharp.Core.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="CefSharp.Wpf, Version=106.0.260.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138">
|
||||
<HintPath>..\packages\CefSharp.Wpf.106.0.260\lib\net452\CefSharp.Wpf.dll</HintPath>
|
||||
<Reference Include="CefSharp.Wpf, Version=107.1.120.0, Culture=neutral, PublicKeyToken=40c4b6fc221f4138">
|
||||
<HintPath>..\packages\CefSharp.Wpf.107.1.120\lib\net452\CefSharp.Wpf.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="log4net, Version=2.0.15.0, Culture=neutral, PublicKeyToken=669e0ddf0bb1aa2a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\log4net.2.0.15\lib\net45\log4net.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Xaml.Behaviors, Version=1.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<HintPath>..\packages\Microsoft.Xaml.Behaviors.Wpf.1.1.19\lib\net45\Microsoft.Xaml.Behaviors.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Xaml">
|
||||
<RequiredTargetFramework>4.0</RequiredTargetFramework>
|
||||
</Reference>
|
||||
@ -179,5 +184,5 @@
|
||||
<Target Name="CefSharpAfterBuildDebug" AfterTargets="AfterBuild">
|
||||
<CallTarget Targets="CefSharpAfterBuildDiagnostic" />
|
||||
</Target>
|
||||
<Import Project="..\packages\CefSharp.Common.106.0.260\build\CefSharp.Common.targets" Condition="Exists('..\packages\CefSharp.Common.106.0.260\build\CefSharp.Common.targets')" />
|
||||
<Import Project="..\packages\CefSharp.Common.107.1.120\build\CefSharp.Common.targets" Condition="Exists('..\packages\CefSharp.Common.107.1.120\build\CefSharp.Common.targets')" />
|
||||
</Project>
|
@ -46,7 +46,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CefSharp.Wpf" Version="106.0.260" />
|
||||
<PackageReference Include="CefSharp.Wpf" Version="107.1.120" />
|
||||
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.39" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -75,7 +75,7 @@
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="CefSharp.Wpf.NetCore" Version="106.0.260" />
|
||||
<PackageReference Include="CefSharp.Wpf.NetCore" Version="107.1.120" />
|
||||
<PackageReference Include="Microsoft.Xaml.Behaviors.Wpf" Version="1.1.19" />
|
||||
</ItemGroup>
|
||||
|
||||
|
@ -1,13 +1,13 @@
|
||||
<Window x:Class="CefSharp.MinimalExample.Wpf.MainWindow"
|
||||
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">
|
||||
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">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
@ -23,6 +23,10 @@
|
||||
<Setter Property="Margin" Value="2,5" />
|
||||
</Style>
|
||||
</Grid.Resources>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto" />
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
@ -30,32 +34,52 @@
|
||||
<ColumnDefinition Width="Auto" />
|
||||
<ColumnDefinition Width="Auto" />
|
||||
</Grid.ColumnDefinitions>
|
||||
<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"/>
|
||||
<TextBox x:Name="txtBoxAddress" Text="{Binding Address, ElementName=Browser, FallbackValue=www.google.com}" Grid.Column="2" FontSize="12" BorderBrush="Gray" BorderThickness="1">
|
||||
<Button Content="Back" Command="{Binding WebBrowser.BackCommand, ElementName=Browser}" Width="50" />
|
||||
<Button Content="Forward" Command="{Binding WebBrowser.ForwardCommand, ElementName=Browser}" Grid.Row="0" Grid.Column="1" Width="60" />
|
||||
<TextBox x:Name="txtBoxAddress" Text="{Binding Address, ElementName=Browser, FallbackValue=www.google.com}" Grid.Row="0" Grid.Column="2" FontSize="12"
|
||||
BorderBrush="Gray" BorderThickness="1">
|
||||
<behaviors:Interaction.Behaviors>
|
||||
<behaviours:TextBoxBindingUpdateOnEnterBehaviour />
|
||||
</behaviors:Interaction.Behaviors>
|
||||
</TextBox>
|
||||
<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="Print..." Command="{Binding WebBrowser.PrintCommand, ElementName=Browser}" Grid.Row="0" Grid.Column="3" Width="50" />
|
||||
<Button Content="View source" Command="{Binding WebBrowser.ViewSourceCommand, ElementName=Browser}" Grid.Row="0" Grid.Column="4" Width="75" />
|
||||
<Grid Grid.Row="1" Grid.Column="0" Grid.ColumnSpan="4">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<TextBox x:Name="JsTb" Grid.Column="0" VerticalContentAlignment="Center"/>
|
||||
<TextBox x:Name="JsArgs1Tb" Grid.Column="1" VerticalContentAlignment="Center"/>
|
||||
<TextBox x:Name="JsArgs2Tb" Grid.Column="2" VerticalContentAlignment="Center"/>
|
||||
<CheckBox Grid.Column="3" x:Name="HasArgsCb" Width="80" VerticalAlignment="Center" HorizontalAlignment="Center" Content="HasArgs"/>
|
||||
<CheckBox Grid.Column="4" x:Name="HasValueCb" Width="80" VerticalAlignment="Center" HorizontalAlignment="Center" Content="HasValue"/>
|
||||
<Button Grid.Column="5" Content="ExcJs" Click="JsBtn_OnClick" x:Name="JsBtn"/>
|
||||
<TextBlock Grid.Column="6" x:Name="JsResultTb" VerticalAlignment="Center"/>
|
||||
</Grid>
|
||||
</Grid>
|
||||
<Border Grid.Row="1" BorderBrush="Gray" BorderThickness="0,1">
|
||||
<wpf:ChromiumWebBrowser x:Name="Browser"
|
||||
Address="https://www.google.com">
|
||||
Address="https://www.google.com">
|
||||
<behaviors:Interaction.Behaviors>
|
||||
<behaviours:HoverLinkBehaviour x:Name="HoverLinkBehaviour"/>
|
||||
<behaviours:HoverLinkBehaviour x:Name="HoverLinkBehaviour" />
|
||||
</behaviors:Interaction.Behaviors>
|
||||
</wpf:ChromiumWebBrowser>
|
||||
</Border>
|
||||
<ProgressBar IsIndeterminate="{Binding IsLoading, ElementName=Browser}"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Top"
|
||||
Width="Auto"
|
||||
Grid.Row="1"
|
||||
Height="2"
|
||||
Visibility="{Binding IsLoading, ElementName=Browser, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
BorderThickness="0" />
|
||||
<ProgressBar
|
||||
IsIndeterminate="{Binding IsLoading, ElementName=Browser}"
|
||||
HorizontalAlignment="Stretch"
|
||||
VerticalAlignment="Top"
|
||||
Width="Auto"
|
||||
Grid.Row="1"
|
||||
Height="2"
|
||||
Visibility="{Binding IsLoading, ElementName=Browser, Converter={StaticResource BooleanToVisibilityConverter}}"
|
||||
BorderThickness="0" />
|
||||
<StatusBar Grid.Row="2" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch">
|
||||
<StatusBar.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
@ -74,9 +98,12 @@
|
||||
<Separator Grid.Column="1" />
|
||||
<StatusBarItem Grid.Column="2">
|
||||
<TextBlock HorizontalAlignment="Right" TextAlignment="Right" Grid.Column="3" VerticalAlignment="Center">
|
||||
Chromium: <Run Text="{Binding Source={x:Static cef:Cef.ChromiumVersion}, Mode=OneTime}" />, CEF: <Run Text="{Binding Source={x:Static cef:Cef.CefVersion}, Mode=OneTime}" />, CefSharp: <Run Text="{Binding Source={x:Static cef:Cef.CefSharpVersion}, Mode=OneTime}"/>, Environment: <Run Text="{Binding Converter={StaticResource EnvironmentConverter}, Mode=OneTime}"/>
|
||||
Chromium: <Run Text="{Binding Source={x:Static cef:Cef.ChromiumVersion}, Mode=OneTime}" />, CEF:
|
||||
<Run Text="{Binding Source={x:Static cef:Cef.CefVersion}, Mode=OneTime}" />, CefSharp:
|
||||
<Run Text="{Binding Source={x:Static cef:Cef.CefSharpVersion}, Mode=OneTime}" />, Environment:
|
||||
<Run Text="{Binding Converter={StaticResource EnvironmentConverter}, Mode=OneTime}" />
|
||||
</TextBlock>
|
||||
</StatusBarItem>
|
||||
</StatusBar>
|
||||
</Grid>
|
||||
</Window>
|
||||
</Window>
|
@ -7,6 +7,63 @@ namespace CefSharp.MinimalExample.Wpf
|
||||
public MainWindow()
|
||||
{
|
||||
InitializeComponent();
|
||||
Browser.FrameLoadStart += BrowserOnFrameLoadStart;
|
||||
Browser.FrameLoadEnd += BrowserOnFrameLoadEnd;
|
||||
}
|
||||
|
||||
private void BrowserOnFrameLoadEnd(object sender, FrameLoadEndEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
private void BrowserOnFrameLoadStart(object sender, FrameLoadStartEventArgs e)
|
||||
{
|
||||
}
|
||||
|
||||
private void JsBtn_OnClick(object sender, RoutedEventArgs e)
|
||||
{
|
||||
object[] args = new object[2];
|
||||
args[0] = JsArgs1Tb.Text;
|
||||
args[1] = JsArgs2Tb.Text;
|
||||
if (HasValueCb.IsChecked ?? false)
|
||||
{
|
||||
ExecuteJs(JsTb.Text, (HasArgsCb.IsChecked ?? false) ? args : null);
|
||||
}
|
||||
else
|
||||
{
|
||||
ExecuteJsNoValue(JsTb.Text, (HasArgsCb.IsChecked ?? false) ? args : null);
|
||||
}
|
||||
}
|
||||
|
||||
private void ExecuteJsNoValue(string js, object[] args = null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(js))
|
||||
{
|
||||
js = args == null ? js : WebBrowserExtensions.GetScriptForJavascriptMethodWithArgs(js, args);
|
||||
Browser.ExecuteScriptAsync(js);
|
||||
}
|
||||
else
|
||||
{
|
||||
JsResultTb.Text = "js is empty!";
|
||||
}
|
||||
}
|
||||
|
||||
private void ExecuteJs(string js, object[] args = null)
|
||||
{
|
||||
if (!string.IsNullOrEmpty(js))
|
||||
{
|
||||
js = args == null ? js : WebBrowserExtensions.GetScriptForJavascriptMethodWithArgs(js, args);
|
||||
Browser.EvaluateScriptAsync(js).ContinueWith(o =>
|
||||
{
|
||||
App.RunUIThread(() =>
|
||||
{
|
||||
JsResultTb.Text = (o?.Result?.Success ?? false) ? o?.Result?.Result?.ToString() : o?.Result?.Message;
|
||||
});
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
JsResultTb.Text = "js is empty!";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1,8 +1,9 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="cef.redist.x64" version="106.0.26" targetFramework="net452" />
|
||||
<package id="cef.redist.x86" version="106.0.26" targetFramework="net452" />
|
||||
<package id="CefSharp.Common" version="106.0.260" targetFramework="net452" />
|
||||
<package id="CefSharp.Wpf" version="106.0.260" targetFramework="net452" />
|
||||
<package id="cef.redist.x64" version="107.1.12" targetFramework="net452" />
|
||||
<package id="cef.redist.x86" version="107.1.12" targetFramework="net452" />
|
||||
<package id="CefSharp.Common" version="107.1.120" targetFramework="net452" />
|
||||
<package id="CefSharp.Wpf" version="107.1.120" targetFramework="net452" />
|
||||
<package id="Microsoft.Xaml.Behaviors.Wpf" version="1.1.19" targetFramework="net452" />
|
||||
<package id="log4net" version="2.0.15" targetFramework="net452" />
|
||||
</packages>
|
@ -1,4 +1,4 @@
|
||||
SET cefsharpversion=106.0.260
|
||||
SET cefsharpversion=107.1.120
|
||||
|
||||
..\nuget restore CefSharp.MinimalExample.sln
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user