private void SetContainerSizeInternal(string containerName, GridLength?width, GridLength?height)
        {
            var toolContainer = DockingManager.FindObjectByName <LayoutAnchorablePane>(containerName);
            var viewContainer = DockingManager.FindObjectByName <LayoutDocumentPane>(containerName);

            if (width.HasValue)
            {
                if (toolContainer != null)
                {
                    toolContainer.DockWidth = width.Value;
                }
                if (viewContainer != null)
                {
                    viewContainer.DockWidth = width.Value;
                }
            }

            if (height.HasValue)
            {
                if (toolContainer != null)
                {
                    toolContainer.DockHeight = height.Value;
                }
                if (viewContainer != null)
                {
                    viewContainer.DockHeight = height.Value;
                }
            }
        }
Esempio n. 2
0
        public void CloseToolIn(string containerName, string viewId)
        {
            var container = DockingManager.FindObjectByName <LayoutGroup <LayoutAnchorable> >(containerName);
            var layout    = container.FindByViewId <LayoutContent>(viewId);

            CloseContent(layout);
        }
Esempio n. 3
0
        public void ShowViewIn(
            string containerName,
            Func <ILifetimeScope, IView> viewFactory,
            ViewRequest viewRequest = null,
            UiShowOptions options   = null)
        {
            var documentPane   = DockingManager.FindObjectByName <LayoutGroup <LayoutContent> >(containerName);
            var layoutDocument = documentPane.FindByViewRequest <LayoutContent>(viewRequest);

            if (layoutDocument == null)
            {
                var view = viewFactory(Container);
                if (options != null)
                {
                    view.Configure(options);
                }

                layoutDocument = new LayoutDocument
                {
                    ContentId = viewRequest?.ViewId,
                    Content   = view
                };
                if (options != null)
                {
                    layoutDocument.CanClose = options.CanClose;
                }

                AddTitleRefreshing(view, layoutDocument);
                AddWindowBehaviour(view, layoutDocument);
                AddClosingByRequest(view, layoutDocument);

                documentPane.Children.Add(layoutDocument);

                InitializeView(view, viewRequest);
            }

            ActivateContent(layoutDocument, viewRequest);
        }
Esempio n. 4
0
        public void ShowToolIn(
            string containerName,
            Func <ILifetimeScope, IToolView> toolFactory,
            ViewRequest viewRequest = null,
            UiShowOptions options   = null)
        {
            var toolsPane        = DockingManager.FindObjectByName <LayoutGroup <LayoutAnchorable> >(containerName);
            var layoutAnchorable = toolsPane.FindByViewRequest <LayoutAnchorable>(viewRequest);

            if (layoutAnchorable == null)
            {
                var view = toolFactory(Container);
                if (options != null)
                {
                    view.Configure(options);
                }

                layoutAnchorable = new LayoutAnchorable
                {
                    ContentId   = viewRequest?.ViewId,
                    Content     = view,
                    CanAutoHide = false,
                    CanFloat    = false,
                };
                view.ViewModel.CanClose = false;
                view.ViewModel.CanHide  = false;

                AddTitleRefreshing(view, layoutAnchorable);
                AddWindowBehaviour(view, layoutAnchorable);
                AddClosingByRequest(view, layoutAnchorable);

                toolsPane.Children.Add(layoutAnchorable);

                InitializeView(view, viewRequest);
            }

            ActivateContent(layoutAnchorable, viewRequest);
        }