You wouldn't have to put it in the button click hander. If you were, then you'd assign your text box a name (x:Name
) in your view and then use the generated member of the same name in the code behind to set the Text
property.
If you were avoiding code behind, then you would investigate the MVVM design pattern and data binding, and bind a property on your view model to the text box's Text
property.