CefSharp.MinimalExample/CefSharp.MinimalExample.Wpf/MainWindow.xaml
Alex Maitland 07049f5e62
Upgrade to 88.2.90 (#131)
* Upgrade to v88.2.40-pre

WPF - Add https scheme to default URL to workaround upstream issue
https://bitbucket.org/chromiumembedded/cef/issues/3079/cant-load-urls-without-scheme

* Net Core - Add AnyCPU Platform to projects/solution

* Net Core - Add RuntimeIdentifier based on PlatformTarget

- Set RuntimeIdentifier based on PlatformTarget (PlatformTarget isn't set of AnyCPU)
- Set SelfContained to false so as not to provide a Framework Dependant build (don't include the whole .net framework)

* WPF/WinForms - Change CefSharpBuildAction to Content

For testing of ClickOnce publish

* Net 5.0 - Update to include PublishSingleFile settings

- .Net 5.0 Publish Settings for PublishSingleFile
  https://docs.microsoft.com/en-us/dotnet/core/deploying/single-file
  Defaults differ compared to .Net Core 3.1
- Set RollForward to Major so runs on newer runtime version
- Add net5.0-windows TargetFramework

* .Net 5.0 - Publish Single Exe Example

- Use the main application exe as the BrowserSubprocess when self publishing a .Net 5.0 exe
- Only the WPF and WinForms examples have been updated

https://github.com/cefsharp/CefSharp/issues/3407

* Upgrade to 88.2.90
2021-03-05 11:15:53 +10:00

82 lines
4.7 KiB
XML

<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}}"
WindowState="Maximized">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid>
<Grid.Resources>
<Style TargetType="{x:Type Button}">
<Setter Property="Margin" Value="2,5" />
</Style>
<Style TargetType="{x:Type TextBox}">
<Setter Property="Margin" Value="2,5" />
</Style>
</Grid.Resources>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition />
<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">
<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" />
</Grid>
<Border Grid.Row="1" BorderBrush="Gray" BorderThickness="0,1">
<wpf:ChromiumWebBrowser x:Name="Browser"
Address="https://www.google.com">
<behaviors:Interaction.Behaviors>
<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" />
<StatusBar Grid.Row="2" HorizontalAlignment="Stretch" HorizontalContentAlignment="Stretch">
<StatusBar.ItemsPanel>
<ItemsPanelTemplate>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*" />
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="Auto" />
</Grid.ColumnDefinitions>
</Grid>
</ItemsPanelTemplate>
</StatusBar.ItemsPanel>
<StatusBarItem Grid.Column="0">
<TextBlock Text="{Binding HoverLink, ElementName=HoverLinkBehaviour}" Grid.Column="2" HorizontalAlignment="Stretch" VerticalAlignment="Center" />
</StatusBarItem>
<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}"/>
</TextBlock>
</StatusBarItem>
</StatusBar>
</Grid>
</Window>