David Straw

The only documentation I could find on the x:ClassModifier says that the two valid values are "Public" and "NonPublic". However, these values do not compile.

It seems that the actual implementation is to use language keywords here. For instance, I was able to achieve what I wanted (a xaml class that is internal to the assembly) by specifying "internal" as the value for this attribute in my C# project. I suspect that in a VB project, the correct value would be "Friend", though I have not tested this.



Re: Windows Presentation Foundation (WPF) x:ClassModifier incorrectly documented

ErinC

This is an old post, so maybe the documentation has been updated. It now says "The value for the x:ClassModifier attribute will vary by programming language", then goes on to provide the details you describe above.

I still receive a warning, however -

Warning 2 The 'http://schemas.microsoft.com/winfx/2006/xaml:ClassModifier' attribute is not declared.

I'm still able to get the correct behavior, despite this warning. It would be nice to disable it somehow....





Re: Windows Presentation Foundation (WPF) x:ClassModifier incorrectly documented

Rob Relyea

Are you using VS2005 or VS2008

If 2008, what version

Thanks, Rob

Rob Relyea | Program Manager, WPF & Xaml Language Team
robrelyea.com | /blog | /wpf | /xaml





Re: Windows Presentation Foundation (WPF) x:ClassModifier incorrectly documented

ErinC

I'm using VS2005





Re: Windows Presentation Foundation (WPF) x:ClassModifier incorrectly documented

Rob Relyea

You could modify Xaml2006.xsd and XamlPresentation2006.xsd (installed under Program Files\Microsoft Visual Studio 2005\xml\schemas) to enable x:ClassModifier to be used without warning.

Those Xml Schemas that used to power Xaml Intellisense in VS 2005 are being replaced by a Xaml aware editor in VS 2008 which is ClassModifier aware. In fact I just tested beta2 of VS 2008, which works happily in this area.

Thanks, Rob

Rob Relyea | Program Manager, WPF & Xaml Language Team
robrelyea.com | /blog | /wpf | /xaml