How use access modifiers (internal, private, public) in XAML with WPF

You can configure the access modifier of objects defined in XAML using x:FieldModifier.

<TextBox Name="MyInternalTextBox" x:FieldModifier="internal" />
<TextBox Name="MyPrivateTextBox" x:FieldModifier="private" />
<TextBox Name="MyPrivateTextBox" x:FieldModifier="protected" />
<TextBox Name="MyPublicTextBox" x:FieldModifier="public" />

Leave a Reply

*