예제 #1
0
        /// <summary>
        ///   Shows a tool window.
        /// </summary>
        /// <param name = "viewModel">The view model.</param>
        /// <param name = "context">The context.</param>
        /// <param name="selectWhenShown">If set to <c>true</c> the window will be selected when shown.</param>
        public void ShowToolWindow(object viewModel, object context, bool selectWhenShown = true)
        {
            var dockableWindow = _dockSite.CreateWindow(viewModel, false, context);

            /*
             * var pane = XamDockManagerHelper.FindSplitPaneWithLocationOrCreate(GetDockingManager(_window), dockstate);
             * pane.Panes.Add(dockableWindow);
             * //If this is a new dockable location (there are no split panes for it)
             * //we need to add it to the XamDockManager
             * if (pane.Parent == null)
             * {
             * DockManager.Panes.Add(pane);
             * }*/

            //  TODO: Add docking location list. Either dock to named dock host, possibly found by an interface named IHaveDockAffinity with a DockName property.
            //  TODO: or IHaveDockLocation with an Enum defining Left, Right, Top, Bottom

            if (selectWhenShown)
            {
                dockableWindow.Activate();
            }
        }