void InitialWindowHandling() { if (UserSettings.WindowSettings != null) { UserSettings.WindowSettings.Apply(this); } else { UserSettings.WindowSettings = WindowSettings.Create(this); } if (UserSettings.AppOptions.AutoAdjustLibraryViewType) { UpdateGridMode(); } }
public MainWindow() { InitializeComponent(); Loaded += (sender, args) => { if (UserSettings.Current.WindowSettings != null) { UserSettings.Current.WindowSettings.Apply(this); } Activate(); DataContext = new MainWindowViewModel(); }; Closing += (sender, args) => { UserSettings.Current.WindowSettings = WindowSettings.Create(this); UserSettings.Current.Save(); }; }
public MainWindow() { InitializeComponent(); KeyUp += OnKeyUp; Loaded += (sender, args) => { if (UserSettings.Current.WindowSettings != null) { UserSettings.Current.WindowSettings.Apply(this); } Activate(); DataContext = new MainWindowViewModel(); }; Closing += (sender, args) => { UserSettings.Current.WindowSettings = WindowSettings.Create(this); UserSettings.Current.Save(); }; this.Loaded += new RoutedEventHandler(Window_Loaded); this.SizeChanged += new SizeChangedEventHandler(WindowSize_Changed); string responseBody = ""; if (GameUpdater.HttpGet("http://www.zombies.nu/motd.txt", out responseBody)) { AnnouncementMessage.Text = responseBody; } if (!String.IsNullOrEmpty(responseBody)) { AnnouncementBorder.BorderBrush = System.Windows.Media.Brushes.Red; } else { AnnouncementBorder.BorderBrush = System.Windows.Media.Brushes.Transparent; } }
protected override void OnDeactivate(bool close) { base.OnDeactivate(close); UserSettings.WindowSettings = WindowSettings.Create(this); }