private void Window_Closing(object sender, CancelEventArgs e) { var userPrefs = new UserPreferences { WindowHeight = Height, WindowWidth = Width, WindowTop = Top, WindowLeft = Left, WindowState = WindowState }; userPrefs.Save(); Settings.Default.role = ""; }
public MainWindow() { InitializeComponent(); sp = new SmartCardOperation(); var userPrefs = new UserPreferences(); Height = userPrefs.WindowHeight; Width = userPrefs.WindowWidth; Top = userPrefs.WindowTop; Left = userPrefs.WindowLeft; WindowState = userPrefs.WindowState; CheckRole(); }