XmlDataProvider.XmlNamespaceManager Property

Gets or sets the XmlNamespaceManager used to run XPath queries.

Namespace: System.Windows.Data
Assembly: PresentationFramework (in presentationframework.dll)
XML Namespace:  http://schemas.microsoft.com/winfx/2006/xaml/presentation

public XmlNamespaceManager XmlNamespaceManager { get; set; }
/** @property */
public XmlNamespaceManager get_XmlNamespaceManager ()

/** @property */
public void set_XmlNamespaceManager (XmlNamespaceManager value)

public function get XmlNamespaceManager () : XmlNamespaceManager

public function set XmlNamespaceManager (value : XmlNamespaceManager)

<object XmlNamespaceManager="mappingCollection"/>
 mappingCollection  An XmlNamespaceMappingCollection. To refer to a XmlNamespaceMappingCollection, use the StaticResource markup extension. 

Property Value

The XmlNamespaceManager used to run XPath queries. The default value is a null reference (Nothing in Visual Basic).

Setting the following properties will implicitly cause this XmlDataProvider object to refresh: Source, Document, XmlNamespaceManager, and XPath. When changing multiple refresh-causing properties, the use of DeferRefresh is recommended.

The following example demonstrates how to use this property.

  <XmlNamespaceMappingCollection x:Key="mapping">
    <XmlNamespaceMapping Uri="http://purl.org/dc/elements/1.1/" Prefix="dc" />

  <XmlDataProvider Source="http://msdn.microsoft.com/subscriptions/rss.xml"
                   XmlNamespaceManager="{StaticResource mapping}"
                   XPath="rss/channel/item" x:Key="provider"/>

  <DataTemplate x:Key="dataTemplate">
    <Border BorderThickness="1" BorderBrush="Gray">
      <Grid Width="600" Height="50">
          <RowDefinition Height="25"/>
          <RowDefinition Height="25"/>
        <TextBlock Grid.Row="0" Text="{Binding XPath=title}" />
        <TextBlock Grid.Row="1" Text="{Binding XPath=dc:date}" />

  ItemsSource="{Binding Source={StaticResource provider}}"
  ItemTemplate="{StaticResource dataTemplate}"/>

For the complete example, see Binding Using XML Namespaces Sample.

Windows 98, Windows Server 2000 SP4, Windows CE, Windows Millennium Edition, Windows Mobile for Pocket PC, Windows Mobile for Smartphone, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0