/// <summary>
        /// Raises the <see cref="ModuleSelected"/> event which is handled by the <see cref="DockingManagerBehavior"/>. 
        /// </summary>
        /// <param name="sender">The sender.</param>
        /// <param name="e">Event arguments.</param>
        private void SelectedModuleListItem(object sender, RoutedEventArgs e)
        {
            var navigationPanelItem = (NavigationPanelItem)e.OriginalSource;
            var moduleSelected = ModuleSelected;
            if (moduleSelected != null)
            {
                var modulePaneEventArgs = new ModuleEventArgs(navigationPanelItem.NavigationPanelItemName);
                moduleSelected(this, modulePaneEventArgs);
            }

            e.Handled = true;
        }
Esempio n. 2
0
        /// <summary>
        /// Toggles between modules, showing documents available to the current 
        /// selected module, while hidding documents relating to other modules.
        /// </summary>
        /// <param name="sender">The <see cref="ModulesNavigationView"/>.</param>
        /// <param name="e">Module event arguments.</param>
        private void ModuleSelected(object sender, ModuleEventArgs e)
        {
            var layoutAnchorablesHide = dockingManager.Layout.Descendents()
                .OfType<LayoutAnchorable>()
                .Where(la => !((DocumentViewHost)la.Content).ModuleName.ToUpper().Equals(e.ModuleName.ToUpper()));

            var anchorablesHide = layoutAnchorablesHide.ToList();

            var layoutAnchorablesShow = dockingManager.Layout.Descendents()
                .OfType<LayoutAnchorable>()
                .Where(la => ((DocumentViewHost)la.Content).ModuleName.ToUpper().Equals(e.ModuleName.ToUpper()));

            var anchorablesShow = layoutAnchorablesShow.ToList();

            for (int i = 0; i < anchorablesHide.Count(); i++)
            {
                anchorablesHide[i].Hide();
            }

            for (int i = 0; i < anchorablesShow.Count(); i++)
            {
                anchorablesShow[i].Show();
            }
        }