public static void RegistInstances(this SimpleContainer container, IEnumerable <Assembly> asms) { foreach (var asm in asms) { container.RegistInstances(asm); } }
public App(SimpleContainer container) { this.Initialize(); //加载 App.xaml this.InitializeComponent(); //线程异常处理 TaskScheduler.UnobservedTaskException += TaskScheduler_UnobservedTaskException; this.Container = container; //注册 ViewModel container.RegistInstances(UsedAssemblies); //修改默认提供器 ApiClientCacheProvider.Default = new ApiClientCacheStore(); BearTokenProvider.Default = new BearerTokenStore(); //初始化 ApiClient, 如正式发布,请删除参数 true this.InitApiClient(true); //Task.Run(async () => { // await this.ShowRootView(); //}); this.ShowRootView(); }