private void ApplyPreferences() { var s = new PreferencesSerializer(); var preferences = s.Load(); DisplayRootViewFor <MainViewModel>(); RegisterKeyCombination((_, __) => aggregator.PublishOnUIThread(new RunAllCommand()), preferences.StartAllShortcut, "RunAll"); RegisterKeyCombination((_, __) => aggregator.PublishOnUIThread(new DebugAllCommand()), preferences.DebugAllShortcut, "DebugAll"); RegisterKeyCombination((_, __) => aggregator.PublishOnUIThread(new StopAllCommand()), preferences.StopAllShortcut, "StopAll"); }
private Preferences ReadPreferences() { var preferences = new Preferences(); var appFolder = Path.GetDirectoryName(Assembly.GetExecutingAssembly().Location); var settingsFilePath = Path.Combine(appFolder, "settings.xml"); if (File.Exists(settingsFilePath)) { PreferencesSerializer.LoadFrom(preferences, settingsFilePath); } return(preferences); }