public App() { this.ShutdownMode = ShutdownMode.OnLastWindowClose; string pathNotes = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "save.notes"); string pathSettings = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "saveSettings.notes"); if (File.Exists(pathSettings)) { MainModel.RestoreSettings(); } else { MainModel.SaveSettings(); } if (File.Exists(pathNotes)) { NoteModel noteModel = new NoteModel(); noteModel.RestoreNotes(); } RegistryAdd.AddToAutorun(); }