<UserControl x:Class="CustomControls.LabeledTextbox"
             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:sys="clr-namespace:System;assembly=mscorlib"
             xmlns:local="clr-namespace:CustomControls"
             mc:Ignorable="d" 
             d:DesignHeight="40" d:DesignWidth="300" MinWidth="200" MinHeight="40" >
    
    <Grid>
        <DockPanel Width="auto" Height="auto"  VerticalAlignment="Top" x:Name="LayoutRoot" >
            <TextBlock Name="Label" Height="auto" Width="auto" HorizontalAlignment="Left" Text="{Binding Text}" Visibility="{Binding Visible}"/>
            <TextBox Name="Data" Height="40" Width="100" Text="{Binding Value, Mode=TwoWay, UpdateSourceTrigger=PropertyChanged}" MinWidth="{Binding TextboxWidth}" IsReadOnly="{Binding TextboxReadonly}" IsEnabled="{Binding Enabled}" Visibility="{Binding Visible}" PreviewKeyDown="Data_PreviewKeyDown"  Margin="10,0,0,0" HorizontalAlignment="Right" HorizontalContentAlignment="Center" VerticalContentAlignment="Center"/>
        </DockPanel>
    </Grid>
</UserControl>
