Exemplo n.º 1
0
 private void InitializeWindowSource(object sender, EventArgs e)
 {
     Messenger.Default.Register<GenericMessage<object>>((object) this, (object) ViewModelMessages.Exit, (Action<GenericMessage<object>>) (o =>
       {
     SettingsData.Instance.Window.Left = this.Left;
     SettingsData.Instance.Window.Top = this.Top;
     if (this.WindowState != WindowState.Maximized)
     {
       SettingsData.Instance.Window.Height = this.Height;
       SettingsData.Instance.Window.Width = this.Width;
     }
     SettingsData.Instance.Window.WindowState = this.WindowState;
     if (this.TaskbarIcon != null)
     {
       this.TaskbarIcon.Visible = false;
       this.TaskbarIcon.Dispose();
       this.TaskbarIcon = (NotifyIcon) null;
     }
     SettingsData.Save();
       }));
       Messenger.Default.Register<GenericMessage<object>>((object) this, (object) ViewModelMessages.SettingsVisible, (Action<GenericMessage<object>>) (o =>
       {
     if ((Visibility) o.Content == Visibility.Collapsed)
     {
       this.LayoutRoot.Children.Remove((UIElement) this.settingsView);
       this.settingsView = (SettingsView) null;
       this.twitViewItems.Visibility = Visibility.Visible;
       Messenger.Default.Send<GenericMessage<object>>(new GenericMessage<object>((object) null), (object) ViewModelMessages.TweetColumnAnimation);
       (this.DataContext as MainViewModel).LeftPaneVisible = Visibility.Visible;
       Messenger.Default.Send<GenericMessage<object>>(new GenericMessage<object>((object) null), (object) ViewModelMessages.AfterSettings);
     }
     else
       this.SettingsButton_Click((object) null, new RoutedEventArgs());
       }));
       Messenger.Default.Register<GenericMessage<object>>((object) this, (object) ViewModelMessages.MainWindowShow, new Action<GenericMessage<object>>(this.ShowWindow));
       Messenger.Default.Register<GenericMessage<object>>((object) this, (object) ViewModelMessages.TrayIconVisible, (Action<GenericMessage<object>>) (o => System.Windows.Application.Current.Dispatcher.BeginInvoke((Action) (() => this.TaskbarIcon.Visible = SettingsData.Instance.MinimisetoTray), new object[0])));
       Messenger.Default.Register<GenericMessage<int>>((object) this, (object) ViewModelMessages.SizeUpdated, (Action<GenericMessage<int>>) (o =>
       {
     this.ManageAccountsButton.Height = (double) o.Content;
     this.tweetOverlay.Margin = new Thickness(0.0, 0.0, 0.0, (double) o.Content);
       }));
 }
Exemplo n.º 2
0
 private void SettingsButton_Click(object sender, RoutedEventArgs e)
 {
     PopupService.CloseView(false);
       MainWindow mainWindow = this;
       SettingsView settingsView1 = new SettingsView();
       settingsView1.Margin = new Thickness(0.0, this.HeaderPanel.Height, 0.0, 0.0);
       SettingsView settingsView2 = settingsView1;
       mainWindow.settingsView = settingsView2;
       this.twitViewItems.Visibility = Visibility.Hidden;
       (this.DataContext as MainViewModel).LeftPaneVisible = Visibility.Hidden;
       this.LayoutRoot.Children.Add((UIElement) this.settingsView);
 }