C1.LiveLinq.LiveViews.Xml Namespace > XmlExtensions Class > AsLive Method : AsLive(XDocument) Method |
'Declaration
Public Overloads Shared Function AsLive( _ ByVal document As System.Xml.Linq.XDocument _ ) As View(Of XDocument)
public static View<XDocument> AsLive( System.Xml.Linq.XDocument document )
Since there can be only one root element in a document, the view based on a document (document.AsLive()
) is similar to the view based on its root element (document.Root.AsLive()
). The difference is that the document view contains the document as its only item, and the root view contains the root as its only item. This difference is essential only when the root of the document is replaced with a different element (and so the whole XML tree changes), then the document view remains valid and shows the changed document contents, whereas the root view becomes disconnected from the document.
Note: This view is owned by the System.Xml.Linq.XDocument object (it is stored as one of its annotations), so, if you create a view for the same document several times, it will be the same object.
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2