Advertisement
Guest User

Untitled

a guest
Oct 6th, 2015
86
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.96 KB | None | 0 0
  1. private void MainTabChanged(object sender, SelectionChangedEventArgs e)
  2. {
  3. int tabItem = ((sender as TabControl)).SelectedIndex;
  4. if (e.Source is TabControl) // This is a soultion of those problem.
  5. {
  6. switch (tabItem)
  7. {
  8. case 0: // Chatting
  9. Debug.WriteLine("Tab: Chatting");
  10. if (MainChatList.Items.Count > 0)
  11. {
  12. MainChatList.SelectedIndex = MainChatList.Items.Count - 1;
  13. MainChatList.ScrollIntoView(MainChatList.Items[MainChatList.Items.Count - 1]);
  14. }
  15. break;
  16. case 1: // Users
  17. Debug.WriteLine("Tab: Users");
  18. break;
  19. case 2: // Friends
  20. Debug.WriteLine("Tab: Friends");
  21. this.OnFriendTabActive();
  22. break;
  23. default:
  24. Debug.WriteLine("Tab: " + tabItem);
  25. break;
  26. }
  27. }
  28. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement