WebView interaction

Eduardo Gomez 3,651 Reputation points
2024-01-29T01:10:49.9466667+00:00

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>

User's image

How can I react when the user presses the "Leave" button

Developer technologies .NET .NET MAUI
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.