protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var container = new CompositionContainer( new AggregateCatalog( new AssemblyCatalog(Assembly.GetExecutingAssembly()), new AssemblyCatalog(typeof(IDialogService).Assembly))); var defaults = new UIServicesDefaults(); container.ComposeExportedValue(container); container.ComposeExportedValue(defaults.DialogService); container.ComposeExportedValue(defaults.FileDialogService); container.ComposeExportedValue(defaults.MessageBoxService); var vm = _mainViewModel = container.GetExportedValue <MainViewModel>(); var win = new MainWindow { DataContext = vm }; win.Show(); if (e.Args.Length > 0) { vm.OpenInternal(e.Args[0], false); } }
protected override void OnStartup(StartupEventArgs e) { var ui = new UIServicesDefaults(); var vm = new MainViewModel(ui); var win = new MainWindow { DataContext = vm }; win.Show(); ui.MessageBoxService.SetOwner(win); }
public void InitTray() { var ui = new UIServicesDefaults(); _tray = Application.Current.FindResource("TrayIcon") as TaskbarIcon; var vm = new TaskbarIconViewModel(this, ui); _tray.DataContext = vm; TaskbarIcon.SetParentTaskbarIcon(Application.Current.MainWindow, _tray); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var ui = new UIServicesDefaults(); var vm = new MainViewModel(ui); var win = new MainWindow { DataContext = vm }; win.Show(); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); IUIServices ui = new UIServicesDefaults(); var win = new MainWindow(); ui.MessageBoxService.SetOwner(win); _mainViewModel = new MainViewModel(ui); win.DataContext = _mainViewModel; win.Show(); }
protected override void OnStartup(StartupEventArgs e) { Process.GetCurrentProcess().PriorityClass = ProcessPriorityClass.High; var ui = new UIServicesDefaults(); var vm = new MainViewModel(ui); var win = new MainWindow { DataContext = vm }; ui.MessageBoxService.SetOwner(win); win.Show(); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var ui = new UIServicesDefaults(); MainViewModel = new MainViewModel(ui); var win = new MainWindow { DataContext = MainViewModel }; win.Show(); ui.MessageBoxService.SetOwner(win); //SfSkinManager.ApplyStylesOnApplication = true; //SfSkinManager.SetVisualStyle(win, VisualStyles.Metro); }
public App() { var container = new CompositionContainer( new AggregateCatalog( new AssemblyCatalog(typeof(IFileDialogService).Assembly), new AssemblyCatalog(typeof(IWindow).Assembly), new AssemblyCatalog(Assembly.GetExecutingAssembly()))); var defaults = new UIServicesDefaults(); container.ComposeExportedValue(defaults.DialogService); container.ComposeExportedValue(defaults.FileDialogService); container.ComposeExportedValue(defaults.MessageBoxService); container.ComposeExportedValue(container); var appManager = container.GetExportedValue <AppManager>(); }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); var ui = new UIServicesDefaults(); MainViewModel = new MainViewModel(ui); var win = new MainWindow { DataContext = MainViewModel }; win.Show(); ui.MessageBoxService.SetOwner(win); DispatcherUnhandledException += (s, args) => { MainViewModel.Dispose(); ui.MessageBoxService.ShowMessage($"Unhandled exception: {args.Exception.Message}. Exiting", App.Title); Shutdown(1); }; }
protected override void OnStartup(StartupEventArgs e) { base.OnStartup(e); Catalog = new AggregateCatalog( new AssemblyCatalog(Assembly.GetExecutingAssembly()), new DirectoryCatalog(Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location), "*.modules.*.dll")); Container = new CompositionContainer(Catalog); var ui = new UIServicesDefaults(); Container.ComposeExportedValue <IUIServices>(ui); Container.ComposeExportedValue(Container); var vm = Container.GetExportedValue <MainViewModel>(); var win = new MainWindow { DataContext = vm }; win.Show(); ui.MessageBoxService.SetOwner(win); }