I am binding the data of a textbox through databinding. Instead of giving the minimum and maximum value like this:
<TextBox Height="24"
HorizontalAlignment="Right"
abc:TextBoxMaskBehaviour.Mask="Decimal"
abc:TextBoxMaskBehaviour.MinimumValue="0"
abc:TextBoxMaskBehaviour.MaximumValue="200"
Margin="0,9,8.5,0" Name="txtCStart"
VerticalAlignment="Top"
Width="106"
MouseWheel="OnMouseWheel">
I want to give it through .xaml.cs file. How to do that?
Apparently (judging from your comments, your question is not very clear), you want to set the
abc:TextBoxMaskBehaviour.MinimumValueandMaximumValuethrough C# code:In general, you set attached properties like this: AttachedPropertyClass.SetAttachedProperty(Control, Value). Likewise, the value can be read with AttachedPropertyClass.GetAttachedProperty(Control).