<UserControl x:Class="PixiEditor.Views.UserControls.PrependTextBlock"
             x:ClassModifier="internal"
             xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
             xmlns:local="clr-namespace:PixiEditor.Views.UserControls"
             mc:Ignorable="d" 
             d:DesignHeight="450" d:DesignWidth="800"
             x:Name="uc">
    <StackPanel Orientation="Horizontal">
        <StackPanel.Resources>
            <Style TargetType="{x:Type TextBox}">
                <Setter Property="Foreground" Value="White" />
                <Style.Triggers>
                    <Trigger Property="IsEnabled" Value="False">
                        <Setter Property="Foreground" Value="#88888A" />
                    </Trigger>
                </Style.Triggers>
            </Style>
        </StackPanel.Resources>
        <TextBlock Visibility="{Binding HidePrepend, ElementName=uc, Converter={InverseBoolToVisibilityConverter}}" Foreground="{Binding PrependColor, ElementName=uc}" Text="{Binding Prepend, ElementName=uc}" IsEnabled="{Binding ElementName=uc, Path=IsEnabled}"/>

        <TextBlock IsEnabled="{Binding ElementName=uc, Path=IsEnabled}">
            <TextBlock.Text>
                <PriorityBinding>
                    <Binding Path="Text" ElementName="uc"/>
                    <Binding Path="Content" ElementName="uc"/>
                </PriorityBinding>
            </TextBlock.Text>
        </TextBlock>

        <TextBlock IsEnabled="{Binding ElementName=uc, Path=IsEnabled}"
                   Visibility="{Binding HidePrepend, ElementName=uc, Converter={InverseBoolToVisibilityConverter}}"
                   Text="{Binding Append, ElementName=uc}" Foreground="{Binding ElementName=uc, Path=AppendColor}"/>
    </StackPanel>
</UserControl>
