I’m using VB.Net. I have a WPF User Control called “NavigationPanel” which I created with the Designer. By default, its scope is Public. When I change its scope to Friend in the file NavigationPanel.xaml.vb, I recieve the following error:
Specified access ‘Public’ for
‘NavigationPanel’ does not match the
access ‘Friend’ specified on one of
its other partial types.
The error applies to a Designer-generated file called NavigationPanel.g.vb. It declares NavigationPanel with the line:
Partial Public Class NavigationPanel
If I manually change “Public” to “Friend” on that line, or if I delete the file, the Designer keeps recreating it with “Public”, and raising the error. I can’t figure out why the Designer thinks it is appropriate to declare the class with the scope “Public”, and I can’t figure out how to convince the Designer to use “Friend” instead.
I think all you can do is make it public or not public since the corresponding API in xaml is limited to that (public by default … non public if you request it) : http://msdn.microsoft.com/en-us/library/ms754029.aspx
Update : yes it is possible. Read comment by T.C.