IDocument CreatePinnedPeekCollectionDocument(TModule module)
        {
            var document = WorkspaceDocumentManagerService.CreateDocument("PeekCollectionView", module.CreatePeekCollectionViewModel());

            document.Title = module.ModuleTitle;
            return(document);
        }
        /// <summary>
        /// Creates and shows a document which view is bound to PeekCollectionViewModel. The document is created and shown using a document manager service named "WorkspaceDocumentManagerService".
        /// Since DocumentsViewModel is a POCO view model, an instance of this class will also expose the PinPeekCollectionViewCommand property that can be used as a binding source in views.
        /// </summary>
        /// <param name="module">A navigation list entry that is used as a PeekCollectionViewModel factory.</param>
        public void PinPeekCollectionView(TModule module)
        {
            if (WorkspaceDocumentManagerService == null)
            {
                return;
            }
            IDocument document = WorkspaceDocumentManagerService.FindDocumentByIdOrCreate(module.DocumentType, x => CreatePinnedPeekCollectionDocument(module));

            document.Show();
        }