コード例 #1
0
        private void InternalSetSelectedDocument(LayoutDocumentItem documentToSelect)
        {
            _internalSetSelectedDocument = true;
            this.SelectedDocument        = documentToSelect;
            _internalSetSelectedDocument = false;

            if ((_documentListBox != null) && (documentToSelect != null))
            {
                _documentListBox.Focus();
            }
        }
コード例 #2
0
        void CreateDocumentLayoutItem(LayoutDocument contentToAttach)
        {
            if (_layoutItems.Any(item => item.LayoutElement == contentToAttach))
                return;

            var layoutItem = new LayoutDocumentItem();
            layoutItem.Attach(contentToAttach);
            ApplyStyleToLayoutItem(layoutItem);
            _layoutItems.Add(layoutItem);

            if (contentToAttach != null &&
                contentToAttach.Content != null &&
                contentToAttach.Content is UIElement)
            {
                InternalAddLogicalChild(contentToAttach.Content);
            }
        }
コード例 #3
0
 void InternalSetSelectedDocument(LayoutDocumentItem documentToSelect)
 {
     _internalSetSelectedDocument = true;
     SelectedDocument             = documentToSelect;
     _internalSetSelectedDocument = false;
 }
コード例 #4
0
        void Layout_ElementAdded(object sender, LayoutElementEventArgs e)
        {
            if (_suspendLayoutItemCreation)
                return;

            if (e.Element is LayoutDocument)
            {
                var document = e.Element as LayoutDocument;
                var documentItem = new LayoutDocumentItem();
                documentItem.Attach(document);
                ApplyStyleToLayoutItem(documentItem);
                _layoutItems.Add(documentItem);
            }
            else if (e.Element is LayoutAnchorable)
            {
                var anchorable = e.Element as LayoutAnchorable;
                var anchorableItem = new LayoutAnchorableItem();
                anchorableItem.Attach(anchorable);
                ApplyStyleToLayoutItem(anchorableItem);
                _layoutItems.Add(anchorableItem);
            }
            else if (e.Element is ILayoutContainer)
            {
                foreach (var document in e.Element.Descendents().OfType<LayoutDocument>().ToArray())
                {
                    var documentItem = new LayoutDocumentItem();
                    documentItem.Attach(document);
                    ApplyStyleToLayoutItem(documentItem);
                    _layoutItems.Add(documentItem);
                }
                foreach (var anchorable in e.Element.Descendents().OfType<LayoutAnchorable>().ToArray())
                {
                    var anchorableItem = new LayoutAnchorableItem();
                    anchorableItem.Attach(anchorable);
                    ApplyStyleToLayoutItem(anchorableItem);
                    _layoutItems.Add(anchorableItem);
                }
            }
        }
コード例 #5
0
        void AttachLayoutItems()
        {
            if (Layout != null)
            {
                foreach (var document in Layout.Descendents().OfType<LayoutDocument>().ToArray())
                {
                    var documentItem = new LayoutDocumentItem();
                    documentItem.Attach(document);
                    ApplyStyleToLayoutItem(documentItem);
                    _layoutItems.Add(documentItem);
                }
                foreach (var anchorable in Layout.Descendents().OfType<LayoutAnchorable>().ToArray())
                {
                    var anchorableItem = new LayoutAnchorableItem();
                    anchorableItem.Attach(anchorable);
                    ApplyStyleToLayoutItem(anchorableItem);
                    _layoutItems.Add(anchorableItem);
                }

                Layout.ElementAdded += new EventHandler<LayoutElementEventArgs>(Layout_ElementAdded);
                Layout.ElementRemoved += new EventHandler<LayoutElementEventArgs>(Layout_ElementRemoved);
            }
        }
コード例 #6
0
 void InternalSetSelectedDocument(LayoutDocumentItem documentToSelect)
 {
     _internalSetSelectedDocument = true;
     SelectedDocument = documentToSelect;
     _internalSetSelectedDocument = false;
 }
コード例 #7
0
 /// <summary>
 /// Provides a secure method for setting the Documents property.  
 /// This dependency property indicates the list of documents.
 /// </summary>
 /// <param name="value">The new value for the property.</param>
 protected void SetDocuments(LayoutDocumentItem[] value)
 {
     SetValue(DocumentsPropertyKey, value);
 }