Exemplo n.º 1
0
        public void Rebuild()
        {
            ViewMode     tempViewMode = _musicTree.CurrentViewMode;
            Stack <long> idStack      = new Stack <long>();

            if (tempViewMode != ViewMode.MAX && CurrentTreeView.SelectedItem is LibraryViewModel model)
            {
                while (model != null)
                {
                    idStack.Push(model.Data.Id);
                    model = model.Parent;
                }
            }

            _musicTree  = new MusicTreeViewModel(LibraryRequestHandler);
            DataContext = _musicTree;

            if (tempViewMode != ViewMode.MAX)
            {
                //Trigger the loading of the current view mode
                _musicTree.CurrentViewMode = tempViewMode;

                _musicTree.RestoreHierarchy(tempViewMode, idStack);
            }
        }
Exemplo n.º 2
0
        public void Rebuild()
        {
            _musicTree  = new MusicTreeViewModel(LibraryRequestHandler);
            DataContext = _musicTree;

            //Trigger the loading of the current view mode
            _musicTree.CurrentViewMode = ViewMode.Classic;
        }
Exemplo n.º 3
0
        public LibraryControl()
        {
            InitializeComponent();

            if (DesignerProperties.GetIsInDesignMode(this))
            {
                _musicTree = new MusicTreeViewModel();
            }
            else
            {
                Loaded   += LibraryControl_Loaded;
                Unloaded += LibraryControl_Unloaded;

                _musicTree = new MusicTreeViewModel(LibraryRequestHandler);
            }

            DataContext = _musicTree;
        }