1

The default FieldModifier value in WPF when using XAML is "internal", unless explicitly stated, e.g.

<Button x:FieldModifier="private" Name="BackButton" Content="Hello stackoverflow"/>

Is there any way to change this default, so that it is no longer necessary to define x:FieldModifier for every single element?

Juan
  • 13
  • 2
  • No way that I know of. Out of curiosity, why does it really matter? Internal is private to your assembly, so as long as you're not doing anything silly it won't have any detrimental side effects. – Kent Boogaart Sep 09 '11 at 22:22
  • hoping to extend an existing framework without recompiling, but rather compiling components separately. however, I was strongly advised not to do this, and was presented with a better alternative using the VisualTreeHelper to access controls in another dll – Juan Sep 09 '11 at 23:30
  • If you are going to walk the visual or logical trees, take a look at helper I posted in response to this question: http://stackoverflow.com/questions/747872/wpf-displaying-a-context-menu-for-a-gridviews-items/749671#749671 – Dennis Sep 09 '11 at 23:45

1 Answers1

0

No. It is part of the WPF/XAML specification and implemented in the XAML Parser. It is similar to how private is the default scope within a class and internal within a namespace.

Dennis
  • 20,275
  • 4
  • 64
  • 80