简体   繁体   中英

How to change the access modifier of a user control

I have a user control created in xaml, lets name it "View". In the View.xaml.cs I changed the access modifier for the class View to internal:

internal partial class View : ViewBase { ... }

After changing the access modifier the compiler states the error:

Partial declarations of 'ABView' have conflicting accessibility modifiers

My first guess was that the view has to be made internal via the xaml code. So I added two lines of xaml:

x:Name="View"
x:FieldModifier="internal"

But this did not fix the error. Where do I have to change the access modifier to make a view internal?

The class modifier is done through "x:ClassModifier".

See http://msdn.microsoft.com/en-us/library/ms754029.aspx for more information.

because its a partial class, another file exists with the line;

public partial class View : ViewBase { ... }

you can search the file and change public to internal, it should solve the problem

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM