void MainWindow_Closing(object sender, CancelEventArgs e) { // Save restore bounds for the next time this window is opened var storage = IsolatedStorageFile.GetUserStoreForAssembly(); using var stream = new IsolatedStorageFileStream(filename, FileMode.Create, storage); using var writer = new StreamWriter(stream); writer.WriteLine(RestoreBounds.ToString(CultureInfo.InvariantCulture)); }
// Hack - this should really go in a behavior, but im feeling lazy. private void OHSTimerApp_Closing(object sender, CancelEventArgs e) { // Save restore bounds for the next time this window is opened IsolatedStorageFile storage = IsolatedStorageFile.GetUserStoreForAssembly(); using (IsolatedStorageFileStream stream = new IsolatedStorageFileStream(_windowSettingsFileName, FileMode.Create, storage)) using (StreamWriter writer = new StreamWriter(stream)) { // Write restore bounds value to file writer.WriteLine(RestoreBounds.ToString()); } }
private void SaveWindowLayout() { _viewModel.Settings.WindowBounds = RestoreBounds.ToString(CultureInfo.InvariantCulture); _viewModel.Settings.WindowState = WindowState.ToString(); }
private void SaveWindowLayout() { Properties.Settings.Default.WindowBounds = RestoreBounds.ToString(); Properties.Settings.Default.WindowState = WindowState.ToString(); }