DataSource for Entity Framework in WPF
C1.LiveLinq.LiveViews.Xml Namespace / XmlExtensions Class / AsLive Method / AsLive(XDocument) Method
The XML document to expose as a view.

In This Topic
    AsLive(XDocument) Method
    In This Topic
    Creates a view based on the specified XML document.
    Syntax
    'Declaration
     
    Public Overloads Shared Function AsLive( _
       ByVal document As XDocument _
    ) As View(Of XDocument)
    public static View<XDocument> AsLive( 
       XDocument document
    )

    Parameters

    document
    The XML document to expose as a view.

    Return Value

    A view representing the specified XML document.
    Remarks

    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.

    See Also