Embed WebPage using Frame

Posts: 5
Joined: Fri Aug 18, 2017 5:25 am

Embed WebPage using Frame

Postby ray6402 » Fri Apr 20, 2018 3:44 am


How do I embed a webpage in XAML using <Frame>?

I currently have:

Code: Select all

<StackPanel Margin="10">
        <Frame Source="https://www.google.co.za"/>

In the XAML Designer I can see it loading the webpage, however in the Simulator I only get a blank screen.

Drilling down into the Visual Tree, I see that the Frame <Source> is "null"
Visual Tree.png
Visual Tree.png (5.26 KiB) Viewed 158 times

Then when I run it in the Chrome browser, I get the same as the simulator.

Drilling down into the html code, I see that the Frame does not have a <Source> property.
HTML.PNG (17.34 KiB) Viewed 158 times

Am I doing something wrong?

JS-Support @Userware
Site Admin
Posts: 884
Joined: Tue Apr 08, 2014 3:42 pm

Re: Embed WebPage using Frame

Postby JS-Support @Userware » Sun Apr 22, 2018 11:55 pm


Please use the <WebView> control for that. (Note: in SL Migration projects, it's called "<WebControl>".


Posts: 5
Joined: Fri Aug 18, 2017 5:25 am

Re: Embed WebPage using Frame

Postby ray6402 » Wed Apr 25, 2018 4:53 am


I tried using the <WebView> control as follows:

Code: Select all

    <Grid Margin="10">
            <RowDefinition Height="auto"/>
            <RowDefinition Height="5"/>
            <RowDefinition Height="*"/>
        <Button Grid.Row="0"
                Content="webview nav"
        <WebView Grid.Row="2"

By clicking on the button, you should show the Google homepage in the remaining area.

Code: Select all

        private void Button_Click(object sender, RoutedEventArgs e)
            TestWeb.Navigate(new Uri("https://www.google.co.za"));

In the designer, it shows:
Designer.PNG (1.04 KiB) Viewed 128 times

When I run the code, nothing happens on button click.
I tried using TestWeb.NavigateToString() as an alternative and that only shows a the URI string instead of the actual webpage.

Can you provide me with an example of how the <WebView> Control should be used instead?

Return to “General Discussion and Other”

Who is online

Users browsing this forum: No registered users and 1 guest