tags:

views:

72

answers:

1

Hi, i m using this code in .xaml, as i created userdefined control(textbox) NumericTextbox

<local:NumericTextBox Grid.Column="1"
       local:NumericTextBox.Mask=" Decimal"
       local:NumericTextBox.MaximumValue=" 255"
       local:NumericTextBox.MinimumValue=" 0"
       Name="abc"
       Grid.Row="0"
       Text="{Binding Path = IPAddressProperty}" />

rather, i want to access that numericaltextbox in .xaml.cs and i have to give that minimum and maximum value also in .xaml.cs file,

can anyone help me out please??

+4  A: 

This question would be much more readable if you put your XAML up in the original post.

You need to give it a name in XAML:

<local:NumericTextBox x:Name="MyTextBox" />

Then you can reference its properties with that name in C# code-behind:

this.MyTextBox.MinimumValue = 0;
this.MyTextBox.MaximumValue = 255;
Dan Auclair
Thank u.. it was very useful
No problem, if it was useful for you feel free to mark as answered.
Dan Auclair