I have a user control that has a textbox in it, and i am using a clear button on my main form to clear information from the entire main window. i would like to clear the textbox in the user control once the clear button is clicked as well. i havent found an easy way to do this. i have tried referencing the control’s name in c# followed by a “.” however the name of the text box does not show up. any help would be appreciated!
Share
WPF declares controls in a
UserControlasprivate. To make yourTextBoxpublicyou declare it with aFieldModifieras in:where
xis the xaml namespacexmlns:x="http://schemas.microsoft.com/winfx/2006/xaml". However the recommended way of clearing aTextBoxis to bind it to a property and then clear the property.