-
Notifications
You must be signed in to change notification settings - Fork 39
/
MainPage.xaml
39 lines (32 loc) · 1.56 KB
/
MainPage.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
<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="http://schemas.microsoft.com/dotnet/2021/maui"
xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml"
xmlns:hwv="clr-namespace:HybridWebView;assembly=HybridWebView"
x:Class="MauiCSharpInteropWebView.MainPage">
<Grid ColumnDefinitions="2*,1*,1*" RowDefinitions="Auto,Auto,1*,3*">
<Label
Text="{Binding CurrentPageName}"
FontSize="32"
HorizontalOptions="Center" />
<Button Grid.Column="1"
Text="Send raw message to JS"
Clicked="OnSendRawMessageToJS"
HorizontalOptions="Center"
IsEnabled="{Binding PageAllowsRawMessage}"
Margin="5" />
<Button Grid.Column="2"
Text="Invoke JS method"
Clicked="OnInvokeJSMethod"
HorizontalOptions="Center"
IsEnabled="{Binding PageAllowsMethodInvoke}"
Margin="5" />
<Label
Grid.Row="1" Grid.ColumnSpan="3"
Text=".NET message log"
FontSize="16"
Margin="5"/>
<Editor Grid.Row="2" Grid.ColumnSpan="3" Text="{Binding MessageLog}" IsReadOnly="True" CursorPosition="{Binding MessageLogPosition}" />
<hwv:HybridWebView Grid.Row="3" Grid.ColumnSpan="3" x:Name="myHybridWebView" HybridAssetRoot="hybrid_root" MainFile="hybrid_app.html"
RawMessageReceived="OnHybridWebViewRawMessageReceived"/>
</Grid>
</ContentPage>