Ejemplo n.º 1
0
        /// <inheritdoc />
        protected override void UpdateCommands()
        {
            base.UpdateCommands();

            var allSiblings = SelectedItems.AllSiblings();
            var atLeastOne  = SelectedItems.Count >= 1;
            var exactlyOne  = SelectedItems.Count == 1;

            CreateLibraryCommand.IsEnabled      = atLeastOne;
            CreatePageCommand.IsEnabled         = exactlyOne;
            DuplicateSelectionCommand.IsEnabled = atLeastOne && GetCommonRoots(SelectedItems).All(e => e.CanDuplicate());
            GroupIntoCommand.IsEnabled          = atLeastOne && allSiblings;

            var libraryInstanceSelected = SelectedItems.Any(x => x.SourceLibrary != null);

            BreakLinkToLibraryCommand.IsEnabled = libraryInstanceSelected;
            OpenLibraryEditorCommand.IsEnabled  = libraryInstanceSelected;
            SelectLibraryCommand.IsEnabled      = libraryInstanceSelected && exactlyOne;
        }