<?xml version="1.0" encoding="utf-8"?>
<ResourceDictionary
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    x:Class="was.touchcopy.features.messaging.ux.MessageContentStickerDataTemplate"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:local="using:was.touchcopy.features.messaging.ux"
    xmlns:messaging="using:was.touchcopy.features.messaging"
    xmlns:ux="using:was.touchcopy.features.messaging.ux"
    xmlns:converters="using:was.touchcopy.features.messaging.converters"
    xmlns:commonconverters="using:was.touchcopy.features.converters">
    
    <converters:MessageContentToImageBackupFileConverter x:Key="MessageContentToImageBackupFileConverter"/>
    <converters:MessageContentAvailabilityToVisibilityConverter x:Key="MessageContentAvailabilityToVisibilityConverter" />
    <commonconverters:VisibilityInverter x:Key="VisibilityInverter" />
    
    <DataTemplate x:Key="MessageContentStickerDataTemplate" x:DataType="messaging:MessageContent">
        <Grid>
            <Border Padding="0" Margin="0,0,0,0" x:Name="borderContent" Visibility="{Binding Converter={StaticResource MessageContentAvailabilityToVisibilityConverter}, Mode=OneTime}">
                <ux:BackupFileImageControl x:Name="image" BackupFile="{x:Bind Converter={StaticResource MessageContentToImageBackupFileConverter}, Mode=OneWay}" Width="100" Height="100" />
            </Border>
            <Grid Visibility="{Binding Visibility, ElementName=borderContent, 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>
    </DataTemplate>
</ResourceDictionary>
