<UserControl
    x:Class="Txgy.Controls.ColorMapBar"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:local="clr-namespace:Txgy.Controls"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    x:Name="colorMapBar"
    d:Background="Red"
    d:DesignHeight="450"
    d:DesignWidth="800"
    mc:Ignorable="d">
    <Grid>
        <Rectangle
            Width="{Binding ElementName=colorMapBar, Path=UcWidth}"
            Height="{Binding ElementName=colorMapBar, Path=UcHeight}"
            HorizontalAlignment="Left"
            d:Fill="Red"
            Fill="{Binding PaletteBrush, RelativeSource={RelativeSource Mode=FindAncestor, AncestorType=UserControl}}" />
        <!--<TextBlock HorizontalAlignment="Right"
                   Text="{Binding ElementName=colorMapBar, Path=TopDepth, StringFormat={}{0:D}m}" />-->
        <TextBlock HorizontalAlignment="Right" Text="{Binding ElementName=colorMapBar, Path=TopDepth, StringFormat={}{0}m}" />
        <!--<TextBlock HorizontalAlignment="Right"
                   VerticalAlignment="Bottom"
                   Text="{Binding ElementName=colorMapBar, Path=BottomDepth, StringFormat={}{0:D}m}" />-->
        <TextBlock
            HorizontalAlignment="Right"
            VerticalAlignment="Bottom"
            Text="{Binding ElementName=colorMapBar, Path=BottomDepth, StringFormat={}{0}m}" />
    </Grid>
</UserControl>
