Beispiel #1
0
        void plugTree_SelectedItemChanged(object sender, RoutedPropertyChangedEventArgs <object> e)
        {
            var sel = plugTree.SelectedItem as TreeViewItem;

            if (sel != null)
            {
                var t = sel.Tag as LibraryComponent;
                t.ChildrenToggled(sel.Header.ToString());
                //library togs

                if (t.Caption == " My Library" && grdDD.Visibility == Visibility.Hidden)
                {
                    Tabs.FadeIn();
                    Container.FadeOut();
                    switch (sel.Header.ToString())
                    {
                    case " Songs":
                        EnumerationsContainer.LibraryUi = LibraryUiMode.Songs;
                        break;

                    case " Artists":
                        EnumerationsContainer.LibraryUi = LibraryUiMode.Artist;
                        break;

                    case " Albums":
                        EnumerationsContainer.LibraryUi = LibraryUiMode.Album;
                        break;

                    case " Genres":
                        EnumerationsContainer.LibraryUi = LibraryUiMode.Genre;
                        break;
                    }
                    RefreshUi();
                }
                else
                {
                    Tabs.FadeOut();
                    Container.FadeIn();
                    LibraryComponent lc = sel.Tag as LibraryComponent;

                    if (!lc.Initialized)
                    {
                        lc.Initialize();
                    }
                    if (!Container.Children.Contains(lc.ComponentUI))
                    {
                        if (lc.ComponentUI != null)
                        {
                            Container.Children.Add(lc.ComponentUI);
                        }
                    }
                    foreach (Control v in Container.Children)
                    {
                        if (v != lc.ComponentUI)
                        {
                            v.FadeOut();
                        }
                    }
                    lc.ComponentUI.FadeIn();
                }
            }
        }