예제 #1
0
        void InitialWindowHandling()
        {
            if (UserSettings.WindowSettings != null)
            {
                UserSettings.WindowSettings.Apply(this);
            }
            else
            {
                UserSettings.WindowSettings = WindowSettings.Create(this);
            }

            if (UserSettings.AppOptions.AutoAdjustLibraryViewType)
            {
                UpdateGridMode();
            }
        }
예제 #2
0
        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;
            }
        }
예제 #4
0
 protected override void OnDeactivate(bool close)
 {
     base.OnDeactivate(close);
     UserSettings.WindowSettings = WindowSettings.Create(this);
 }