Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private void MainTabChanged(object sender, SelectionChangedEventArgs e)
- {
- int tabItem = ((sender as TabControl)).SelectedIndex;
- if (e.Source is TabControl) // This is a soultion of those problem.
- {
- switch (tabItem)
- {
- case 0: // Chatting
- Debug.WriteLine("Tab: Chatting");
- if (MainChatList.Items.Count > 0)
- {
- MainChatList.SelectedIndex = MainChatList.Items.Count - 1;
- MainChatList.ScrollIntoView(MainChatList.Items[MainChatList.Items.Count - 1]);
- }
- break;
- case 1: // Users
- Debug.WriteLine("Tab: Users");
- break;
- case 2: // Friends
- Debug.WriteLine("Tab: Friends");
- this.OnFriendTabActive();
- break;
- default:
- Debug.WriteLine("Tab: " + tabItem);
- break;
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement