Beispiel #1
0
        internal static Engine ComposeObjectGraph(ILogger logger)
        {
            TestThing(logger);

            ColorSchemeManager.ComposeColorSchemeExtensions(logger);

            var mruEntries = PopulateDebugEntries();
            var mruSettings = new MRUUserSettingsHandler(logger);

            var fileClerk = new FileClerk<DataFile>(logger,
                new FileHandler<DataFile>(logger)
                {
                    Filter = "Test Data Files (*.dat)|*.dat|All Files (*.*)|*.*",
                    DefaultExt = "dat",
                    DefaultFileName = string.Empty
                }
                );

            var viewModels = new ViewModelProvider
            {
                ActivityPageViewModel = new ActivityPageViewModel(fileClerk),
                StartPageViewModel = new StartPageViewModel(ref mruEntries),
            };

            var pages = new PageProvider
            {
                ActivityPage = new ActivityPage(viewModels.ActivityPageViewModel),
                StartPage = new StartPage(viewModels.StartPageViewModel)
            };

            var shellView = new ShellView(new ShellViewModel(logger, fileClerk, ref mruSettings,
                pages, viewModels));

            var dialogs = new DialogPack {
                AboutDialog = new AboutDialog(new AboutViewModel(), shellView, null),
                SettingsDialog=new SettingsDialog(new SettingsViewModel(), shellView, null),
                ProgressDialog = new ProgressDialog(shellView, ProgressDialogSettings.Cancellable),
                };

            shellView.SetDialogs(dialogs);

            return new Implementation(shellView, logger);
        }
Beispiel #2
0
 internal void SetDialogs(DialogPack dialogs)
 {
     _settingsDialog = dialogs.SettingsDialog;
     _aboutDialog = dialogs.AboutDialog;
     _progressDialog = dialogs.ProgressDialog;
 }