public void UpdateViewModels(ViewMode newView) { MessageView.ChangeViewMode(newView, selectedUser, currentSearch); SearchView.ChangeViewMode(newView); UpdateUserView(); switch (newView) { case ViewMode.MainView: SenderView = new TweetSenderView(application); break; case ViewMode.UserView: SenderView = new TweetSenderView(application, selectedUser.Handle); break; case ViewMode.ConversationView: SenderView = null; break; case ViewMode.DMView: SenderView = new DirectMessageSenderView(application, selectedUser.Handle); break; case ViewMode.SearchView: SenderView = new TweetSenderView(application); break; } }
public void HandleClick(ClickEventArgs args) { switch (args.Type) { case ClickType.UserSelect: ChangeSelectedUser(new User(args.Value)); ViewMode = ViewMode.UserView; break; case ClickType.ConversationSelect: ChangeSelectedUser(new User(args.Value)); ViewMode = ViewMode.DMView; break; case ClickType.UserSearch: currentSearch = new Search(args.Value, false); ViewMode = ViewMode.SearchView; break; case ClickType.TweetSearch: currentSearch = new Search(args.Value, true); ViewMode = ViewMode.SearchView; break; case ClickType.ExitSearch: ViewMode = ViewMode.MainView; break; case ClickType.OpenFilter: FilterView.Visibility = Visibility.Visible; break; case ClickType.SubmitFilter: FilterView.Visibility = Visibility.Collapsed; MessageView.ChangeViewMode(ViewMode, selectedUser, currentSearch); break; } }