Use code in cs file

BorisopritBorisoprit Member ✭✭✭

How do is change this code to use the Source of the Mywebview that is in the cs file

MainPage.xaml





            <ProgressBar Progress="0.2"  
                HorizontalOptions="FillAndExpand"  
                x:Name="progress"  
                ProgressColor="Maroon"    
                IsVisible="True"/>
            <app1:MyWebView Source="https://docs.google.com" WidthRequest="1000" HeightRequest="1000"   Navigating="OnNavigating"  Navigated="OnNavigated"  />
        </StackLayout>

In MainPage.xaml.cs

MyWebView = "https://docs.google.com";

Is not working

Tagged:

Best Answer

Answers

  • BorisopritBorisoprit Member ✭✭✭

    Change this but no luck

    <app1:MyWebView WidthRequest="1000" HeightRequest="1000" Navigating="OnNavigating" Navigated="OnNavigated" />

  • BorisopritBorisoprit Member ✭✭✭

    Thanks JohnHardman ,

    This works , give a X:Name of course.

    Never tryed it before like this , but thanks for the solution

    <app1:MyWebView x:Name="webview" WidthRequest="1000" HeightRequest="1000" Navigating="OnNavigating" Navigated="OnNavigated" />

    webview.Source = "https://docs.google.com";

Sign In or Register to comment.