Share Properties from Child app to Base project

后端 未结 1 609
遇见更好的自我
遇见更好的自我 2020-12-22 11:08

I am Working on Windows Phone app Development: i have a requirement here.

i have 3 project,

1) BaseLibrary project - library project i.e., Phone Class Librar

相关标签:
1条回答
  • 2020-12-22 11:47
    namespace BaseLibrary
    {
        [Export("base",typeof(AppSettingsDefaultImpl))]
        class AppSettings : AppSettingsDefaultImpl
            {
                public override string getAppName()
                {
                    return "ABC";
                }
    
            }
    }
    
    namespace ChildApp1
    {
        [Export("child",typeof(AppSettingsDefaultImpl))]
        class AppSettings : AppSettingsDefaultImpl
            {
                public override string getAppName()
                {
                    return "ABC";
                }
    
            }
    }
    

    Then:

    CompositionContainer container;// override MefBootstrapper
    
    AppSettingsDefaultImpl appSettings = 
        container.GetExport<AppSettingsDefaultImpl>("child");
    
    0 讨论(0)
提交回复
热议问题