Skip to content

ScrollableHtmlView

Rico Suter edited this page Jul 19, 2015 · 5 revisions
  • Package: MyToolkit.Extended
  • Platforms: WP7SL, WP8SL, WinRT, UWP

An HtmlView with scrollbars to support lazy loading of objects (virtualizing list). You can use the HeaderTemplate property to add a header or footer on top of the generated controls within the scroll viewer.

You should always prefer to use ScrollableHtmlView with HeaderTemplate and FooterTemplate than a HtmlView in a ScrollViewer with own elements as header and footer because the first variant provides list virtualization and has much better performance for large HTML content.

<controls:HtmlTextBlock ShowHeader="True" ShowFooter="True" 
                        Html="My html" x:Name="HtmlPresenter">
    <controls:HtmlTextBlock.HeaderTemplate>
        <DataTemplate>
            <TextBlock Text="My header" />
        </DataTemplate>
    </controls:HtmlTextBlock.HeaderTemplate>
    <controls:HtmlTextBlock.FooterTemplate>
        <DataTemplate>
            <TextBlock Text="My footer" />
        </DataTemplate>
    </controls:HtmlTextBlock.FooterTemplate>
</controls:HtmlTextBlock>

Set maximum content width

To set the maximum allowed width of the content set the InnerMaxWidth property. The content well be centered in the control.

Clone this wiki locally