Files
cefsharp/CefSharp.Wpf.Example/Views/Main/MainView.xaml
T

87 lines
4.0 KiB
XML

<UserControl x:Class="CefSharp.Wpf.Example.Views.Main.MainView"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:cefSharp="clr-namespace:CefSharp.Wpf;assembly=CefSharp.Wpf"
xmlns:Example="clr-namespace:CefSharp.Example;assembly=CefSharp.Example"
mc:Ignorable="d"
d:DesignWidth="640"
d:DesignHeight="480">
<Grid>
<TextBlock Text="CefSharp WPF Rocks!"
FontSize="72"
FontWeight="Bold"
HorizontalAlignment="Center"
VerticalAlignment="Center" />
<DockPanel>
<DockPanel VerticalAlignment="Top"
DockPanel.Dock="Top">
<Button Height="23"
Width="75"
Command="{Binding WebBrowser.BackCommand}">Back</Button>
<Button Height="23"
Width="75"
Command="{Binding WebBrowser.ForwardCommand}">Forward</Button>
<Button Height="23"
Name="goStopButton"
Width="75"
DockPanel.Dock="Right"
Command="{Binding GoCommand}">Go</Button>
<TextBox Height="23"
Text="{Binding AddressEditable, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}"
GotKeyboardFocus="OnTextBoxGotKeyboardFocus"
GotMouseCapture="OnTextBoxGotMouseCapture">
<TextBox.InputBindings>
<KeyBinding Key="Enter"
Command="{Binding GoCommand}" />
</TextBox.InputBindings>
</TextBox>
</DockPanel>
<GroupBox VerticalAlignment="Top"
DockPanel.Dock="Top">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="Auto" />
<ColumnDefinition Width="*" />
</Grid.ColumnDefinitions>
<Label Grid.Row="0"
Grid.Column="0"
Content="Angle:" />
<Slider Grid.Row="0"
Grid.Column="1"
Name="angleSlider"
Minimum="-180"
Maximum="180" />
<Label Grid.Row="1"
Grid.Column="0"
Content="Opacity:" />
<Slider Grid.Row="1"
Grid.Column="1"
Name="opacitySlider"
Minimum="0"
Maximum="1"
TickFrequency="0.01"
Value="0.90" />
</Grid>
</GroupBox>
<Label Name="outputLabel"
DockPanel.Dock="Bottom" />
<cefSharp:WebView x:Name="webView"
Opacity="{Binding ElementName=opacitySlider, Path=Value}"
Address="{Binding Address, Mode=TwoWay}"
WebBrowser="{Binding WebBrowser, Mode=OneWayToSource}">
<FrameworkElement.LayoutTransform>
<TransformGroup>
<RotateTransform Angle="{Binding Value, ElementName=angleSlider}" />
</TransformGroup>
</FrameworkElement.LayoutTransform>
</cefSharp:WebView>
</DockPanel>
</Grid>
</UserControl>