Beispiel #1
0
 public static void CloseView(bool doNotDisposeActiveView = false)
 {
     if (PopupService.popupServiceInstance == null)
     return;
       PopupService.popupServiceInstance.previousViews.Clear();
       PopupService.popupServiceInstance.Close();
       Messenger.Default.Send<GenericMessage<object>>(new GenericMessage<object>((object) Visibility.Collapsed), (object) ViewModelMessages.TweetOverlayVisible);
       App.AppState.EnableMainWindowControlBox = true;
       foreach (System.Windows.Controls.UserControl view in PopupService.popupServiceInstance.contentContainer.Children)
       {
     TweetListViewModel tweetListViewModel = view.DataContext as TweetListViewModel;
     if ((!doNotDisposeActiveView || view != PopupService.popupServiceInstance.activeView) && (tweetListViewModel == null || tweetListViewModel.TweetType != TweetListType.MentionsMyTweetsRetweeted && tweetListViewModel.TweetType != TweetListType.DirectMessages && tweetListViewModel.TweetType != TweetListType.FriendsTimeline))
       PopupService.DisposeViewDataContext(view);
       }
       PopupService.popupServiceInstance.activeView = (System.Windows.Controls.UserControl) null;
       PopupService.popupServiceInstance.contentContainer.Children.Clear();
       PopupService.popupServiceInstance.Owner.SizeChanged -= new SizeChangedEventHandler(PopupService.popupServiceInstance.Owner_SizeChanged);
       PopupService.popupServiceInstance = (PopupService) null;
 }
Beispiel #2
0
 public static void ShowView(System.Windows.Controls.UserControl view)
 {
     if (PopupService.popupServiceInstance == null)
       {
     PopupService.popupServiceInstance = new PopupService();
     PopupService.popupServiceInstance.Show();
     Messenger.Default.Send<GenericMessage<object>>(new GenericMessage<object>((object) Visibility.Visible), (object) ViewModelMessages.TweetOverlayVisible);
     App.AppState.EnableMainWindowControlBox = false;
       }
       view.Margin = new Thickness(0.0, 0.0, 0.0, 0.0);
       view.Width = PopupService.popupServiceInstance.contentWidth;
       PopupService.popupServiceInstance.PushView(view);
 }