WebView interaction
Eduardo Gomez
3,651
Reputation points
I have a joingMeetingPage in my app, with a viewModel
public partial class JoinMeetingPageViewModel(AppShell appShell, IHttpService httpService) : BaseViewModel {
double currentFlyoutWith;
[ObservableProperty]
bool isWebViewVisible;
[ObservableProperty]
string? text;
[RelayCommand]
void Search() {
}
[RelayCommand]
void EntryCompleted() {
GoToite();
}
private void GoToite() {
if(!string.IsNullOrEmpty(Text)) {
IsWebViewVisible = true;
currentFlyoutWith = appShell.FlyoutWidth;
appShell.FlyoutWidth = 0;
}
}
}
<Grid
Margin="10"
ColumnDefinitions="*,100"
RowDefinitions="60,*">
<Entry Placeholder="Paste your url here" Text="{Binding Text}">
<Entry.Behaviors>
<mct:EventToCommandBehavior EventName="Completed" Command="{Binding EntryCompletedCommand}"/>
</Entry.Behaviors>
</Entry>
<Button
Grid.Column="1"
Command="{Binding SearchCommand}"
Margin="10,0,0,0"
Text="Search" />
<WebView x:Name="JoinWebView" Source="{Binding Text}" Grid.Row="1" IsVisible="{Binding IsWebViewVisible}"/>
</Grid>
How can I react when the user presses the "Leave" button
Developer technologies .NET .NET MAUI
4,152 questions
Sign in to answer