Пример #1
0
 public void RemoveTabAndLastSet(TabItemViewModel vm)
 {
     RemoveTab(vm);
     if (vm is VideoViewModel && VideoTabs.Count > 0)
     {
         SelectedTab = VideoTabs.FirstOrDefault();
     }
     else if (vm is UserViewModel && UserTabs.Count > 0)
     {
         SelectedTab = UserTabs.FirstOrDefault();
     }
     else if (vm is PublicMylistViewModel && MylistTabs.Count > 0)
     {
         SelectedTab = MylistTabs.FirstOrDefault();
     }
     else if (vm is CommunityViewModel && CommunityTabs.Count > 0)
     {
         SelectedTab = CommunityTabs.FirstOrDefault();
     }
     else if (vm is LiveViewModel && LiveTabs.Count > 0)
     {
         SelectedTab = LiveTabs.FirstOrDefault();
     }
     else if (vm is PlayListViewModel && PlayListTabs.Count > 0)
     {
         SelectedTab = PlayListTabs.FirstOrDefault();
     }
     else
     {
         SelectedTab = TabItems.Last();
     }
 }
Пример #2
0
 public void AddTab(TabItemViewModel vm)
 {
     if (vm is VideoViewModel)
     {
         VideoTabs.Add(vm);
     }
     else if (vm is UserViewModel)
     {
         UserTabs.Add(vm);
     }
     else if (vm is PublicMylistViewModel)
     {
         MylistTabs.Add(vm);
     }
     else if (vm is CommunityViewModel)
     {
         CommunityTabs.Add(vm);
     }
     else if (vm is LiveViewModel)
     {
         LiveTabs.Add(vm);
     }
     else if (vm is PlayListViewModel)
     {
         PlayListTabs.Add(vm);
     }
     else
     {
         TabItems.Add(vm);
     }
 }
        private void BPrevPl_Click(object sender, RoutedEventArgs e)
        {
            var t = (ScrollViewer)PlayListTabs.Template.FindName("ScrollViewerTab", PlayListTabs);

            PlayListTabs.FindName("LeftClickButton");
            if (PlayListTabs.SelectedIndex - 1 < 0)
            {
                PlayListTabs.SelectedIndex = PlayListTabs.Items.Count - 1;
            }
            else
            {
                PlayListTabs.SelectedIndex = PlayListTabs.SelectedIndex - 1;
            }
            t.ScrollToHorizontalOffset(PlayListTabs.SelectedIndex * 110);
        }