title: How to fullfile text mask in textbox
body: <p>I am using infragistics controls for masked input. I created my own masked input for IP address and inherent class from XamMaskedInput.</p>
  
  <p>The inherited class looks like:</p>
  
  <pre><code>   public class IpMaskedTextBox : XamMaskedInput
      {
          BrushConverter bc = new BrushConverter();
          public IpMaskedTextBox() : base()
          {
              Background = (Brush) bc.ConvertFrom("#F0FAFF");
              BorderThickness = new Thickness(0);
              BorderBrush = null;
              Padding = new Thickness(5,0,5,0);
              FontWeight = FontWeights.Bold;
              VerticalContentAlignment = VerticalAlignment.Center;
              HorizontalContentAlignment = HorizontalAlignment.Center;
          }
  
          // Prevent space character
          protected override void OnPreviewKeyDown(System.Windows.Input.KeyEventArgs e)
          {
              base.OnPreviewKeyDown(e);
  
              switch (e.Key)
              {
                  case Key.Right:
                      e.Handled = true;
                      break;
                  case Key.Left:
                      e.Handled = true;
                      break;
              }
          }
      }
  </code></pre>
  
  <p>and the appearance on xaml:  </p>
  
  <p><img src="https://i.stack.imgur.com/yUwCZ.png" alt="Masked input"></p>
  
  <p>My question is, how can I full fill the prompt char on whole scope from textbox, that does not have free spaces on right and left.  </p>
  
  <p>Here the link to <a href="http://help.infragistics.com/Help/Doc/WPF/2012.1/CLR4.0/html/InfragisticsWPF4.Controls.Editors.XamMaskedInput.v12.1~Infragistics.Controls.Editors.XamMaskedInput_members.html" rel="nofollow noreferrer">infragistics xamMaskedInput API</a>.</p>
  
  <p><strong>Update:</strong></p>
  
  <p>The result should be like this:<br>
  <img src="https://i.stack.imgur.com/ylYxD.png" alt="Final appearence"></p>
  
  <p><strong>Update 2:</strong></p>
  
  <p>Finally i found the style:</p>
  
  <pre><code>   &lt;Style x:Key="MaskedInputStyle" TargetType="igEditors:XamMaskedInput"&gt;
          &lt;Setter Property="Background" Value="White" /&gt;
          &lt;Setter Property="Foreground" Value="Black" /&gt;
          &lt;Setter Property="igPrim:XamlHelper.SnapsToDevicePixels" Value="True" /&gt;
          &lt;Setter Property="SpinButtonStyle" Value="{StaticResource spinButtonStyle}" /&gt;
          &lt;Setter Property="BorderThickness" Value="1"/&gt;
          &lt;Setter Property="Padding" Value="2"&gt;&lt;/Setter&gt;
          &lt;Setter Property="BorderBrush" Value="{StaticResource SilverlightDarkBrush}"/&gt;
          &lt;Setter Property="HorizontalContentAlignment" Value="Left"/&gt;
          &lt;Setter Property="Template"&gt;
              &lt;Setter.Value&gt;
                  &lt;ControlTemplate TargetType="igEditors:XamMaskedInput"&gt;
                      &lt;igPrim:ValidationDecorator x:Name="MainBorder"&gt;
                          &lt;VisualStateManager.VisualStateGroups&gt;
                              &lt;VisualStateGroup x:Name="CommonStates"&gt;
                                  &lt;VisualState x:Name="MouseOver"&gt;
                                      &lt;Storyboard&gt;
                                          &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="OverBorder"&gt;
                                              &lt;EasingDoubleKeyFrame KeyTime="0" Value="1"/&gt;
                                          &lt;/DoubleAnimationUsingKeyFrames&gt;
                                      &lt;/Storyboard&gt;
                                  &lt;/VisualState&gt;
                                  &lt;VisualState x:Name="Disabled"&gt;
                                      &lt;Storyboard&gt;
                                          &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="PART_InputTextBox"&gt;
                                              &lt;EasingDoubleKeyFrame KeyTime="0" Value="0.25"/&gt;
                                          &lt;/DoubleAnimationUsingKeyFrames&gt;
                                      &lt;/Storyboard&gt;
                                  &lt;/VisualState&gt;
                                  &lt;VisualState x:Name="Normal"/&gt;
                                  &lt;VisualState x:Name="ReadOnly"/&gt;
                              &lt;/VisualStateGroup&gt;
                              &lt;VisualStateGroup x:Name="FocusStates"&gt;
                                  &lt;VisualState x:Name="Unfocused"/&gt;
                                  &lt;VisualState x:Name="Focused"&gt;
                                      &lt;Storyboard&gt;
                                          &lt;DoubleAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="OverBorder"&gt;
                                              &lt;EasingDoubleKeyFrame KeyTime="0" Value="1"/&gt;
                                          &lt;/DoubleAnimationUsingKeyFrames&gt;
                                      &lt;/Storyboard&gt;
                                  &lt;/VisualState&gt;
                              &lt;/VisualStateGroup&gt;
                          &lt;/VisualStateManager.VisualStateGroups&gt;
                          &lt;Grid&gt;
                              &lt;Grid.ColumnDefinitions&gt;
                                  &lt;ColumnDefinition /&gt;
                              &lt;/Grid.ColumnDefinitions&gt;
                              &lt;!-- SSP 10/11/11 TFS91203 - Moved this border to surround the text box below. This is
                              to fix an issue where if the border thickness is set to a large value, the borders cover the contents. --&gt;
                              &lt;!--&lt;Border x:Name="BgBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="1" Visibility="Visible" CornerRadius="2" Margin="0"/&gt;
                              &lt;Border x:Name="OverBorder" BorderThickness="1" CornerRadius="1" Opacity="0" Margin="1" BorderBrush="{StaticResource FocusBorderFillKey}" Grid.ColumnSpan="2"/&gt;--&gt;
                              &lt;!-- SSP 10/11/11 TFS91203 - Moved this here from above. See comments above. --&gt;
                              &lt;Border x:Name="BgBorder" Background="{TemplateBinding Background}" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Grid.ColumnSpan="1" Visibility="Visible" CornerRadius="2" Margin="0"&gt;
                                  &lt;!-- SSP 10/11/11 TFS91426 - Changed the VerticalAlignment from Center to Stretch so the 
                                       VerticalContentAlignment takes effect. 
                                  --&gt;
                                  &lt;Grid&gt;
                                      &lt;Grid.ColumnDefinitions&gt;
                                          &lt;ColumnDefinition/&gt;
                                          &lt;ColumnDefinition Width="Auto"/&gt;
                                      &lt;/Grid.ColumnDefinitions&gt;
                                      &lt;!-- SSP 10/11/11 TFS91426 - Changed the VerticalAlignment from Center to Stretch so the 
                                       VerticalContentAlignment takes effect. 
                                  --&gt;
                                      &lt;!-- SSP 7/11/13 TFS128674 - Added IsInputMethodEnabled binding --&gt;
                                      &lt;Grid&gt;
                                          &lt;igEditorsPrim:MaskedInputTextBox
                                              x:Name="PART_InputTextBox"
                                              Style="{StaticResource maskedInputTextBoxStyle}"
                                              HorizontalAlignment="Stretch"
                                              HorizontalContentAlignment="{TemplateBinding HorizontalContentAlignment}"
                                              VerticalContentAlignment="{TemplateBinding VerticalContentAlignment}"
                                              TextAlignment="{Binding HorizontalContentAlignment, Converter={StaticResource horizToTextAlignmentConverter}, Mode=OneWay, RelativeSource={RelativeSource TemplatedParent}}"
                                              Foreground="{TemplateBinding Foreground}"
                                              InputMethod.IsInputMethodEnabled="{TemplateBinding InputMethod.IsInputMethodEnabled}" 
                                              InputMethod.PreferredImeState="{TemplateBinding InputMethod.PreferredImeState}" 
                                              Margin="{TemplateBinding Padding}"
                                              VerticalAlignment="Stretch"
                                      igPrim:XamlHelper.Focusable="{TemplateBinding igPrim:XamlHelper.Focusable}"
                                      IsTabStop="{TemplateBinding IsTabStop}"
                                   /&gt;
                                          &lt;Border x:Name="OverBorder" BorderThickness="1" CornerRadius="1" Opacity="0" BorderBrush="{StaticResource FocusBorderFillKey}" Grid.ColumnSpan="2"/&gt;
                                      &lt;/Grid&gt;
                                      &lt;Grid x:Name="PART_SpinButtons" Grid.Column="1" Visibility="{TemplateBinding SpinButtonVisibilityResolved}" Margin="1"&gt;
                                          &lt;Grid.RowDefinitions&gt;
                                              &lt;RowDefinition Height="*"/&gt;
                                              &lt;RowDefinition Height="1"/&gt;
                                              &lt;RowDefinition Height="*"/&gt;
                                          &lt;/Grid.RowDefinitions&gt;
                                          &lt;RepeatButton x:Name="spinUp" Style="{TemplateBinding SpinButtonStyle}" ContentTemplate="{StaticResource IncreaseGlyphKey}" &gt;
                                              &lt;ig:Commanding.Command&gt;
                                                  &lt;igEditorsPrim:MaskedInputCommandSource EventName="Click" CommandId="SpinUp" /&gt;
                                              &lt;/ig:Commanding.Command&gt;
                                          &lt;/RepeatButton&gt;
                                          &lt;RepeatButton x:Name="spinDown" Style="{TemplateBinding SpinButtonStyle}" Grid.Row="2" ContentTemplate="{StaticResource DecreaseGlyphKey}"&gt;
                                              &lt;ig:Commanding.Command&gt;
                                                  &lt;igEditorsPrim:MaskedInputCommandSource EventName="Click" CommandId="SpinDown" /&gt;
                                              &lt;/ig:Commanding.Command&gt;
                                          &lt;/RepeatButton&gt;
                                      &lt;/Grid&gt;
                                  &lt;/Grid&gt;
                              &lt;/Border&gt;
                          &lt;/Grid&gt;
                      &lt;/igPrim:ValidationDecorator&gt;
                  &lt;/ControlTemplate&gt;
              &lt;/Setter.Value&gt;
          &lt;/Setter&gt;
      &lt;/Style&gt;
  </code></pre>