File tree Expand file tree Collapse file tree 2 files changed +59
-4
lines changed
src/Avalonia.WebView2.Sample.Mobile/Views Expand file tree Collapse file tree 2 files changed +59
-4
lines changed Original file line number Diff line number Diff line change 1919 </Design .DataContext>
2020
2121 <DockPanel >
22- <TextBox
23- x : Name =" UrlTextBox"
22+ <Grid
2423 Margin =" {Binding StatusBarMargin}"
25- DockPanel.Dock=" Top"
26- Watermark =" Enter the HTTPS address, then press the Enter key to navigate." />
24+ ColumnDefinitions =" auto, auto, auto, *"
25+ DockPanel.Dock=" Top" >
26+ <Button
27+ x : Name =" GoBackButton"
28+ Grid.Column=" 0"
29+ IsEnabled =" {Binding CanGoBack, ElementName=WV}" >
30+ <TextBlock Text =" ← " >
31+ <TextBlock .RenderTransform>
32+ <TransformGroup >
33+ <ScaleTransform ScaleX =" 2" ScaleY =" 2" />
34+ <TranslateTransform Y =" -2" />
35+ </TransformGroup >
36+ </TextBlock .RenderTransform>
37+ </TextBlock >
38+ </Button >
39+ <Button x : Name =" GoForwardButton" Grid.Column=" 1" >
40+ <TextBlock Text =" → " >
41+ <TextBlock .RenderTransform>
42+ <TransformGroup >
43+ <ScaleTransform ScaleX =" 2" ScaleY =" 2" />
44+ <TranslateTransform Y =" -2" />
45+ </TransformGroup >
46+ </TextBlock .RenderTransform>
47+ </TextBlock >
48+ </Button >
49+ <Button x : Name =" Refresh" Grid.Column=" 2" >
50+ <TextBlock Text =" ↻ " >
51+ <TextBlock .RenderTransform>
52+ <TransformGroup >
53+ <ScaleTransform ScaleX =" 2" ScaleY =" 2" />
54+ <TranslateTransform Y =" -2" />
55+ </TransformGroup >
56+ </TextBlock .RenderTransform>
57+ </TextBlock >
58+ </Button >
59+
60+ <TextBox
61+ x : Name =" UrlTextBox"
62+ Grid.Column=" 3"
63+ Watermark =" Enter the HTTPS address, then press the Enter key to navigate." />
64+ </Grid >
65+
2766 <wv2 : WebView2
2867 x : Name =" WV"
2968 DockPanel.Dock=" Bottom"
Original file line number Diff line number Diff line change @@ -18,6 +18,22 @@ public MainView()
1818
1919 WV . StorageService = this ;
2020 //WV.Fill = new SolidColorBrush(Colors.Purple);
21+
22+ GoBackButton . Click += ( s , e ) =>
23+ {
24+ if ( WV . CanGoBack )
25+ {
26+ WV . GoBack ( ) ;
27+ }
28+ } ;
29+ GoForwardButton . Click += ( s , e ) =>
30+ {
31+ if ( WV . CanGoForward )
32+ {
33+ WV . GoForward ( ) ;
34+ }
35+ } ;
36+ Refresh . Click += ( s , e ) => WV . Reload ( ) ;
2137 }
2238
2339 IEnumerable < KeyValuePair < ( StorageItemType type , string key ) , StorageItemValue > > ? IStorageService . GetStorages ( string requestUri )
You can’t perform that action at this time.
0 commit comments