<?xml version="1.0" encoding="utf-8"?>
<ResourceDictionary
    x:Class="was.droidtransfer.features.messaging.ux.MessageContentTextDataTemplate"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:converters="using:was.droidtransfer.features.messaging.converters"
    xmlns:commonconverters="using:was.droidtransfer.features.converters"
    xmlns:data="using:was.droidtransfer.features.messaging.data">
    <converters:MessageContentToTextConverter x:Key="MessageContentToTextConverter" />
    <converters:MessageTextToFontSizeConverter x:Key="MessageTextToFontSizeConverter" />
    <commonconverters:ValueToVisibilityConverter x:Key="ValueToVisibilityConverter"/>
    <DataTemplate x:Key="MessageContentTextDataTemplate">
        <Grid>
            <TextBlock x:Name="textBlockMessageText" TextWrapping="Wrap"
                   Visibility="{Binding Text, RelativeSource={RelativeSource Mode=Self}, Converter={StaticResource ValueToVisibilityConverter}}" Padding="0" Margin="0" FontSize="{Binding Text, RelativeSource={RelativeSource Mode=Self}, Converter={StaticResource MessageTextToFontSizeConverter}}" DataContextChanged="_textBlockMessageText_DataContextChanged" Loaded="_textBlockMessageText_Loaded" Unloaded="_textBlockMessageText_Unloaded" />
            <Border x:Name="borderMessageText" Background="#FF000000" Visibility="{Binding Text, ElementName=textBlockMessageText, Converter={StaticResource ValueToVisibilityConverter}, ConverterParameter='invert'}" Height="20" VerticalAlignment="Top" Loaded="_borderMessageText_Loaded" Unloaded="_borderMessageText_Unloaded"/>
        </Grid>
    </DataTemplate>
</ResourceDictionary>
