-
Notifications
You must be signed in to change notification settings - Fork 72
Expand file tree
/
Copy pathMainWindowV1.xaml
More file actions
122 lines (114 loc) · 5.9 KB
/
MainWindowV1.xaml
File metadata and controls
122 lines (114 loc) · 5.9 KB
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
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
<Window xmlns="https://github.com/avaloniaui" MinWidth="500" MinHeight="300"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:webview="clr-namespace:WebViewControl;assembly=WebViewControl.Avalonia"
x:Class="SampleWebView.Avalonia.MainWindowV1"
Title="Sample WebView"
ExtendClientAreaToDecorationsHint="True"
ExtendClientAreaChromeHints="PreferSystemChrome"
TransparencyLevelHint="AcrylicBlur"
Background="Transparent">
<NativeMenu.Menu>
<NativeMenu>
<NativeMenuItem Header="Edit">
<NativeMenuItem.Menu>
<NativeMenu>
<NativeMenuItem Header="Undo" Command="{Binding UndoCommand}" Gesture="CMD+Z" />
<NativeMenuItem Header="Redo" Command="{Binding RedoCommand}" Gesture="Shift+CMD+Z" />
<NativeMenuItemSeparator />
<NativeMenuItem Header="Cut" Command="{Binding CutCommand}" Gesture="CMD+X" />
<NativeMenuItem Header="Copy" Command="{Binding CopyCommand}" Gesture="CMD+C" />
<NativeMenuItem Header="Paste" Command="{Binding PasteCommand}" Gesture="CMD+V" />
<NativeMenuItem Header="Delete" Command="{Binding DeleteCommand}" Gesture="CMD+Back" />
<NativeMenuItemSeparator />
<NativeMenuItem Header="Select All" Command="{Binding SelectAllCommand}" Gesture="CMD+A" />
</NativeMenu>
</NativeMenuItem.Menu>
</NativeMenuItem>
<NativeMenuItem Header="Navigate">
<NativeMenuItem.Menu>
<NativeMenu>
<NativeMenuItem Header="Back" Command="{Binding BackCommand}" />
<NativeMenuItem Header="Forward" Command="{Binding ForwardCommand}" />
</NativeMenu>
</NativeMenuItem.Menu>
</NativeMenuItem>
</NativeMenu>
</NativeMenu.Menu>
<Panel>
<ExperimentalAcrylicBorder IsHitTestVisible="False">
<ExperimentalAcrylicBorder.Material>
<ExperimentalAcrylicMaterial BackgroundSource="Digger"
TintColor="{DynamicResource SystemAltHighColor}"
TintOpacity="1"
FallbackColor="Black"
MaterialOpacity="0.25" />
</ExperimentalAcrylicBorder.Material>
</ExperimentalAcrylicBorder>
<DockPanel>
<DockPanel DockPanel.Dock="Top" Margin="0 0 400 0">
<Button DockPanel.Dock="Right"
Background="Transparent"
Command="{Binding ShowDevToolsCommand}">
Show DevTools
</Button>
<CheckBox DockPanel.Dock="Right"
Background="Transparent"
IsEnabled="False"
IsChecked="{Binding TextAvailable}">
Text
</CheckBox>
<Button DockPanel.Dock="Right"
Background="Transparent"
IsEnabled="{Binding !TextAvailable}"
Command="{Binding GetTextCommand}">
Get Text
</Button>
<CheckBox DockPanel.Dock="Right"
Background="Transparent"
IsEnabled="False"
IsChecked="{Binding SourceAvailable}">
Source
</CheckBox>
<Button DockPanel.Dock="Right"
Background="Transparent"
IsEnabled="{Binding !SourceAvailable}"
Command="{Binding GetSourceCommand}">
Get Source
</Button>
<TextBox Background="Transparent" TabIndex="0" Text="{Binding Address}" Margin="80 0 0 0">
<TextBox.KeyBindings>
<KeyBinding Gesture="Enter" Command="{Binding NavigateCommand}" />
</TextBox.KeyBindings>
</TextBox>
</DockPanel>
<DockPanel Dock="Bottom"
VerticalAlignment="Center"
Background="LightGray"
IsVisible="{Binding IsDownloading}">
<Grid DockPanel.Dock="Right"
Margin="10, 10, 10, 10"
RowDefinitions="Auto, Auto, Auto"
ColumnDefinitions="Auto">
<Label Grid.Row="0" Grid.Column="0"
Content="{Binding DownloadMessage}"/>
<Label Grid.Row="1" Grid.Column="0"
Content="{Binding DownloadProgress}"/>
<ProgressBar Grid.Row="2" Grid.Column="0"
VerticalAlignment="Center"
Background="Transparent"
Height="26"
Foreground="Aqua"
IsIndeterminate="{Binding !IsDownloadDeterminate}"
Value="{Binding DownloadPercentage}" />
<TextBlock Grid.Row="2" Grid.Column="0"
Background="Transparent"
HorizontalAlignment="Center"
VerticalAlignment="Center"
IsVisible="{Binding IsDownloadDeterminate}"
Text="{Binding DownloadPercentage, StringFormat={}{0:0}%, Mode=OneWay}" />
</Grid>
</DockPanel>
<webview:WebView x:Name="webview" Focusable="True" Address="{Binding CurrentAddress}" />
</DockPanel>
</Panel>
</Window>