locked
web view control few queires RRS feed

  • Question

  • Hi,

    I do have few queries on web view control.

    1. Adding a web view control with height=auto and width=auto does not render the web view control. Is it mandate to give fixed height and width to web view control?

    2. How could I Bind a html text using Binding property below(that generally we do using webviewname.NavigateToString(htmldata. To bind it individually please note that web view control is part of my list view control item template)

    <WebView   Source="{Binding ContentExcerpt}" Grid.Row="1"></WebView>

    3. If I need to set height and width of web view control based on my html content, what could be ideal way of doing that.

    Thanks in advance


    Thanks & Regards Tejaswi Chandrapatla

    Wednesday, August 13, 2014 1:47 PM

All replies

  • 1) Yes

    2) You can't do this without using NavigateToString. 


    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Thursday, August 14, 2014 12:00 AM
    Moderator
  • Could it be possible to use converter or so and do that. If not so, then one need to construct a list view dynamically and bind it.

    Thanks & Regards Tejaswi Chandrapatla

    Thursday, August 14, 2014 1:34 AM
  • You can bind to a Uri but not to text.  WebView control simply doesn't have that ability.  That said, you can dynamically create an HTML file in the local storage and bind to that.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Thursday, August 14, 2014 12:57 PM
    Moderator
  • Could be done by using a dependency property for web view control. But as per height vs width dynamic assignment I'm finding a way to figure out how better it could be achieved.

    Thanks & Regards Tejaswi Chandrapatla

    Thursday, August 14, 2014 2:32 PM