c# - Design View Model as internal class -
i'm working on windows runtime component project must expose few controls outside world. use design view models have like:
public sealed class firstpaneldesignviewmodel { ... }
it works supposed during design time class exposed outside world of project, thing not desirable. can modify this:
internal class firstpaneldesignviewmodel { ... }
but designer (.xaml file opened) complains cannot access class , render not occur anymore:
the name "firstpaneldesignviewmodel" not exist in namespace "using:someproject.designviewmodels".
is there way use design view models in windows runtime component without exposing outside?
i guess use friend assemlies
using system.runtime.compilerservices; using system; [assembly: internalsvisibleto("assemblyb")] // class internal default. class friendclass { public void test() { console.writeline("sample class"); } } // public class has internal method. public class classwithfriendmethod { internal void test() { console.writeline("sample method"); } }
Comments
Post a Comment