<UserControl x:Class="MECF.Framework.UI.Core.Control.IntegerTextBox" 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:MECF.Framework.UI.Core.Control" mc:Ignorable="d" x:Name="self" d:DesignHeight="35" d:DesignWidth="200"> <Grid> <Grid.RowDefinitions> <RowDefinition Height="*"></RowDefinition> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="*"></ColumnDefinition> </Grid.ColumnDefinitions> <TextBox Name="txtInput" VerticalContentAlignment="Center" Grid.Row="0" Grid.RowSpan="2" Text="{Binding ElementName=self,Path=Value}" PreviewTextInput="OnPreviewTextInput" InputMethod.IsInputMethodEnabled="False" KeyDown="txtInput_KeyDown"></TextBox> </Grid> </UserControl>