<!-- Resource Dictionary used to store a Data Template used to 
     display internet link content.
     This data template will be selected by the MessageContentSelector class if the message 
     content is determined to be of Application type. -->
    <ResourceDictionary
    x:Class="was.touchcopy.features.messaging.ux.MessageContentInternetDataTemplate"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:was.touchcopy.features.messaging.ux"
    xmlns:converters="using:was.touchcopy.features.messaging.converters"
    xmlns:messaging="using:was.touchcopy.features.messaging"
    xmlns:commonConverters="using:was.touchcopy.features.converters">

    <converters:MessageSettingsInternetPreviewToVisibilityConverter x:Key="MessageSettingsInternetPreviewToVisibilityConverter"/>
    <converters:MessageContentToInternetLinkConverter x:Key="MessageContentToInternetLinkConverter"/>
    <messaging:MessagingSettingsPage x:Key="MessagingSettingsPage"/>
    <commonConverters:ValueToVisibilityConverter x:Key="ValueToVisibilityConverter"/>

    <DataTemplate x:Key="MessageContentInternetDataTemplate" x:Name="daf">
        <StackPanel>
            <Grid Margin="0,0,0,5">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="auto"/>
                    <ColumnDefinition Width="*"/>
                    <ColumnDefinition Width="auto"/>
                </Grid.ColumnDefinitions>
                <SymbolIcon Symbol="Globe" Margin="0,7,5,0" VerticalAlignment="Top" Foreground="Black"/>
                <TextBlock Grid.Column="1" Text="{Binding ContentLocation}" TextWrapping="Wrap"  VerticalAlignment="Center" Foreground="Black"/>
                <HyperlinkButton Grid.Column="2"  HorizontalAlignment="Right" x:Name="buttonNavigateToUri" Margin="10,0,0,0"
                                 VerticalAlignment="Top" Foreground="{ThemeResource SystemAccentColor}"
                                 NavigateUri="{Binding Converter={StaticResource MessageContentToInternetLinkConverter} }">
                    <HyperlinkButton.Content>
                        <FontIcon Glyph="&#xE8A7;"/>
                    </HyperlinkButton.Content>
                </HyperlinkButton>
            </Grid>
            <WebView2 x:Name="webViewControl"  Source="{Binding ElementName=buttonNavigateToUri, Path=NavigateUri}" Width="600" Height="450" 
                      Visibility="{Binding Converter={StaticResource MessageSettingsInternetPreviewToVisibilityConverter}}"
                      Loaded="WebViewControl_Loaded"/>

        </StackPanel>
    </DataTemplate>
</ResourceDictionary>
