<?xml version="1.0" encoding="utf-8"?>
<ResourceDictionary
    x:Class="was.touchcopy.features.messaging.ux.MessageContentImagePlaceholderDataTemplate"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:converters="using:was.touchcopy.features.messaging.converters"
    xmlns:commonconverters="using:was.touchcopy.features.converters">

    <converters:MessageContentToImageMaxWidthConverter x:Key="MessageContentToImageMaxWidthConverter"/>
    <converters:MessageContentToImageHeightConverter x:Key="MessageContentToImageHeightConverter" />
    <converters:MessageContentToImageWidthConverter x:Key="MessageContentToImageWidthConverter" />
    <converters:MessageContentAvailabilityToVisibilityConverter x:Key="MessageContentAvailabilityToVisibilityConverter" />
    <commonconverters:VisibilityInverter x:Key="VisibilityInverter" />

    <DataTemplate x:Key="MessageContentImagePlaceholderDataTemplate">
        <Border Padding="0" Margin="0,0,0,0" CornerRadius="{ThemeResource HyperlinkFocusRectCornerRadius}" Background="Transparent"
        Height="{Binding Converter={StaticResource MessageContentToImageHeightConverter}}" 
        Width="{Binding Converter={StaticResource MessageContentToImageWidthConverter}}"
        MaxWidth="{Binding Converter={StaticResource MessageContentToImageMaxWidthConverter}}">
            <Grid>
                <Grid x:Name="gridContent" Visibility="{Binding Converter={StaticResource MessageContentAvailabilityToVisibilityConverter}, Mode=OneTime}">
                    <Border Background="{ThemeResource AppBarBackgroundThemeBrush}" PointerPressed="BorderContent_PointerPressed">
                        <StackPanel VerticalAlignment="Center" HorizontalAlignment="Center" Padding="10" Spacing="5">
                            <FontIcon Glyph="&#xEB9F;" />
                            <TextBlock x:Uid="TextBlockImageClickToView" Text="Image: Click to View" TextWrapping="WrapWholeWords" TextAlignment="Center" />
                        </StackPanel>
                    </Border>
                </Grid>
                <Grid Visibility="{Binding Visibility, ElementName=gridContent, Converter={StaticResource VisibilityInverter}, Mode=OneWay}" ColumnSpacing="12">
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="*"/>
                        <ColumnDefinition Width="Auto" />
                    </Grid.ColumnDefinitions>
                    <StackPanel VerticalAlignment="Center">
                        <TextBlock x:Uid="TextBlockImageUnavailable" Text="XX Image unavailable." Style="{ThemeResource BodyStrongTextBlockStyle}"/>
                        <TextBlock x:Uid="TextBlockAttachmentNotStoredOnDevice" Text="XX It may not be stored on your device." Style="{ThemeResource CaptionTextBlockStyle}"/>
                    </StackPanel>
                    <HyperlinkButton x:Uid="HyperlinkButtonAttachmentUnavailable" VerticalAlignment="Center" Grid.Column="1" CornerRadius="16" Padding="4">
                        <FontIcon Glyph="&#xE897;" />
                    </HyperlinkButton>
                </Grid>
            </Grid>
        </Border>
    </DataTemplate>

</ResourceDictionary>
