<< Click to Display Table of Contents >>

Navigation:  NinjaScript > Language Reference > Add On >


Previous page Return to chapter overview Next page

NumericTextBox provides functionality for numeric text boxes to capture user input. This UI element can be defined in XAML for an AddOn if desired, with functionality and logic related to the text box defined in C#, as in the examples below.


Note:  For a complete, working example of this class in use, download framework example located on our Developing AddOns Overview



NumericTextBox inherits from System.Windows.Controls.Textbox, and the following additional properties can be accessed for an instance the class:



Determines the minimum value which can be entered


Determines the maximum value which can be entered


Determines the System.Type which can be accepted




ns XAML Definition of the UI Element

<!-- Create a grid in which to place the NumericTextBox -->
  <!-- Define a NumericTextBox -->
  <t:NumericTextBox x:Name="daysBackSelector" Text="5" ValueType="{x:Type system:Int32}" Width="50" Grid.Column="2">
      <!-- Set the margins for the box -->
          <Thickness Left="{StaticResource MarginButtonLeft}" Top="{StaticResource PaddingColumn}" Right="{StaticResource MarginBase}"/>



ns C# Code Handling Logic

private NumericTextBox daysBack;
private DependencyObject LoadXAML()
      // Find days back selector
      daysBack = LogicalTreeHelper.FindLogicalNode(pageContent, "daysBackSelector") as NumericTextBox;