<UserControl x:Class="Artemis.UI.Shared.DefaultTypes.DataModel.Display.DefaultDataModelDisplayView"
             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:Artemis.UI.Shared.DefaultTypes.DataModel.Display"
             xmlns:s="https://github.com/canton7/Stylet"
             xmlns:shared="clr-namespace:Artemis.UI.Shared"
             mc:Ignorable="d"
             d:DesignHeight="450" d:DesignWidth="800"
             d:DataContext="{d:DesignInstance local:DefaultDataModelDisplayViewModel}">
    <UserControl.Resources>
        <shared:NullToVisibilityConverter x:Key="NullToVisibilityConverter" />
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="*" />
            <ColumnDefinition Width="Auto"/>
            <ColumnDefinition Width="Auto"/>
        </Grid.ColumnDefinitions>

        <!-- Prefix -->
        <TextBlock Grid.Column="0" 
                   Text="{Binding PropertyDescription.Prefix}"
                   Visibility="{Binding PropertyDescription.Prefix, Converter={StaticResource NullToVisibilityConverter}}" 
                   TextAlignment="Right"
                   Margin="0 0 5 0" />

        <!-- Value -->
        <TextBlock Grid.Column="1"
                   Text="{Binding DisplayValue, Mode=OneWay}"
                   HorizontalAlignment="Right"
                   Visibility="{Binding ShowToString, Converter={x:Static s:BoolToVisibilityConverter.Instance}, Mode=OneWay}" />
        <TextBlock Grid.Column="1"
                   Text="null"
                   FontFamily="Consolas"
                   HorizontalAlignment="Right"
                   Foreground="{DynamicResource MaterialDesignCheckBoxDisabled}"
                   Visibility="{Binding ShowNull, Converter={x:Static s:BoolToVisibilityConverter.Instance}, Mode=OneWay}" />

        <!-- Affix -->
        <TextBlock Grid.Column="2" 
                   Text="{Binding PropertyDescription.Affix}"
                   Visibility="{Binding PropertyDescription.Affix, Converter={StaticResource NullToVisibilityConverter}}" 
                   Margin="5 0 0 0" />
    </Grid>
</UserControl>