コード例 #1
0
ファイル: ContentPaneProxy.cs プロジェクト: realaace/PrismPoC
 internal static void SetAssociatedProxy(ContentPane pane, ContentPaneProxy value)
 {
     pane.SetValue(AssociatedProxyPropertyKey, value);
 }
コード例 #2
0
ファイル: SplitPaneProxy.cs プロジェクト: realaace/PrismPoC
        /// <summary>
        /// Adds a <see cref="ContentPaneProxy"/> to this proxy.  
        /// </summary>
        /// <param name="contentPaneProxy">The ContentPaneProxy to add to the split pane.</param>
        /// <param name="isInTabGroup">
        /// True if the <see cref="ContentPane"/> should be added to a <see cref="TabPaneGroup"/> 
        /// contained within the <see cref="SplitPane"/> element.
        /// </param>
        public void AddContentPaneProxy(ContentPaneProxy contentPaneProxy, bool isInTabGroup)
        {
            _contentPaneProxies.Add(contentPaneProxy);

            if (isInTabGroup)
            {
                this.TabGroupPaneProxy.AddContentPaneProxy(contentPaneProxy);
                contentPaneProxy.ContentPane.Activate();
            }
            else
            {
                this.SplitPane.Panes.Add(contentPaneProxy.ContentPane);
                contentPaneProxy.ContentPane.Activate();
            }
        }
コード例 #3
0
 internal void AddContentPaneProxy(ContentPaneProxy contentPaneProxy)
 {
     contentPaneProxy.Closed += this.OnContentPaneProxyClosed;
     _contentPaneProxies.Add(contentPaneProxy);
     _tabGroupPane.Items.Add(contentPaneProxy.ContentPane);
 }
コード例 #4
0
        public void AddContentPaneToDocumentHost(ContentPaneProxy contentPaneProxy)
        {
            if (contentPaneProxy == null)
                throw new ArgumentNullException("contentPaneProxy");

            // YCL - .NET Framework 4.0 bug?
            // Need to disassociate view from ContentPane. Otherwise, when adding view to DocumentContentHost
            // will cause the error: Specified element is already the logical child of another element. Disconnect it first.

            //----------------- Original Code. Works on .NET Framework 4.5 -------------------
            //  _xamDockManager.AddDocument(contentPaneProxy.Header, contentPaneProxy.ContentPane.Content);
            //----------------- End Original Code --------------------------------------------

            //----------------- New Code. Works on .NET Framework 4.0 and 4.5-----------------

            DependencyObject depObj = contentPaneProxy.ContentPane.Content as DependencyObject;
            ContentPane cp = LogicalTreeHelper.GetParent(depObj) as ContentPane;
            if (cp != null)
                cp.Content = null;

            ContentPane newCP;
            newCP = _xamDockManager.AddDocument(contentPaneProxy.Header, depObj);
            newCP.Name = contentPaneProxy.ContentPane.Name;
            newCP.Activate();

            //----------------- End New Code -------------------------------------------------
        }