예제 #1
0
        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));
        }
예제 #2
0
        // 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());
                }
        }
예제 #3
0
 private void SaveWindowLayout()
 {
     _viewModel.Settings.WindowBounds = RestoreBounds.ToString(CultureInfo.InvariantCulture);
     _viewModel.Settings.WindowState  = WindowState.ToString();
 }
예제 #4
0
 private void SaveWindowLayout()
 {
     Properties.Settings.Default.WindowBounds = RestoreBounds.ToString();
     Properties.Settings.Default.WindowState  = WindowState.ToString();
 }