protected override void Load(ContainerBuilder builder) { builder.Add <IAppEnvironment, WinEnvironment>(); builder.Add <ILocalVideoSourceManager, LocalVideoSourceManager>(); builder.Add <ILocalAudioSourceManager, LocalAudioSourceManager>(); builder.Add <IWindowStateManager, WindowStateManager>(); builder.Add <IUpdateManager, UpdateManager>(); builder.Add <ICpuService, CpuService>(); builder.Add <IVpnService, VpnService>(); builder.Add <IImageHelper, ImageHelper>(); }
public static void RunApp <T>(Application app) { RemoveCefSharpShortcuts(); app.Resources.MergedDictionaries.Add(new BundledTheme { BaseTheme = BaseTheme.Dark, PrimaryColor = PrimaryColor.Indigo, SecondaryColor = SecondaryColor.Blue }); app.Resources.MergedDictionaries.Add(new ResourceDictionary { Source = new Uri("pack://application:,,,/MaterialDesignThemes.Wpf;component/Themes/MaterialDesignTheme.Defaults.xaml") }); SetTheme(); #if DEBUG #else if (!SetSingleStart("Streamster.Client")) { MessageBox.Show("The application is already running", "Launch Application Error", MessageBoxButton.OK, MessageBoxImage.Error); app.Shutdown(); return; } #endif ContainerBuilder builder = new ContainerBuilder(); builder.RegisterModule <DependencyInjection>(); builder.RegisterModule <CoreDependencyInjection>(); builder.Add <IAppResources, T>(); var container = builder.Build(); container.Resolve <LogService>(); var root = container.Resolve <RootModel>(); root.ByeByeModel = container.Resolve <ByeByeModel>(); root.NavigateTo(container.Resolve <LoginModel>()); var windowStateManager = container.Resolve <IWindowStateManager>(); // consider move this to dispatcher call MainWindow mainWindow = new MainWindow(); mainWindow.DataContext = root; mainWindow.Root = root; ((WindowStateManager)windowStateManager).SetWindow(mainWindow); mainWindow.Show(); }
protected override void Load(ContainerBuilder builder) { builder .Add <LogService>() .Add <LocalSettingsService>() .Add <ConnectionService>() .Add <NotificationService>() .Add <HubConnectionService>() .Add <StaticFilesCacheService>() .Add <IDeltaServiceProvider, DeltaServiceProvider>() .Add <CoreData>() .Add <IdService>() .Add <ResourceService>() .Add <StateLoggerService>(); builder .Add <RootModel>() .Add <LoginModel>() .Add <UpdateModel>() .Add <MainModel>() .Add <ByeByeModel>() .Add <MainTargetsModel>() .Add <MainSettingsModel>() .Add <MainStreamerModel>() .Add <MainFiltersModel>() .Add <MainIndicatorsModel>() .Add <SourcesModel>() .Add <ScreenRendererModel>() .Add <MainAboutModel>() .Add <MainVpnModel>() .Add <TransientMessageModel>() .Add <SceneEditingModel>() .Add <AudioModel>() .Add <StreamSettingsModel>() .Add <TranscodingModel>(); }
public void Add(IFactoryBuilderInstance item) { Builder.Add(item); }