forked from q71114/ScriptVsNewWindow
-
Notifications
You must be signed in to change notification settings - Fork 0
/
MainWindow.xaml
50 lines (50 loc) · 2.01 KB
/
MainWindow.xaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
<Window x:Class="ScriptVsNewWindow.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:local="clr-namespace:ScriptVsNewWindow"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:wv2="clr-namespace:Microsoft.Web.WebView2.Wpf;assembly=Microsoft.Web.WebView2.Wpf"
x:Name="Root"
Title="MainWindow"
Width="800"
Height="450"
mc:Ignorable="d">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="Auto" />
<RowDefinition Height="0.7*" />
<RowDefinition Height="0.3*" />
</Grid.RowDefinitions>
<StackPanel Orientation="Horizontal">
<Button x:Name="CopyLog"
Margin="4"
Padding="8,2"
Click="CopyLog_Click">
Copy Log
</Button>
<Button x:Name="ClearLog"
Margin="4"
Padding="8,2"
Click="ClearLog_Click">
Clear Log
</Button>
</StackPanel>
<DockPanel Margin="4,0" Grid.Row="1">
<Button Content="Open homepage" Click="OpenDefaultHomepage" />
<TextBlock Text="Type in an url and press enter to navigate:" />
<TextBox KeyUp="TextBox_KeyUp" HorizontalAlignment="Stretch" />
</DockPanel>
<wv2:WebView2 x:Name="WebView" Grid.Row="2" />
<Border Grid.Row="3"
Margin="2"
HorizontalAlignment="Stretch"
VerticalAlignment="Top"
BorderBrush="Black"
BorderThickness="0,1,0,0" />
<ScrollViewer Grid.Row="3" Margin="0,4,0,0">
<ItemsControl ItemsSource="{Binding ElementName=Root, Path=Log}" />
</ScrollViewer>
</Grid>
</Window>