0

I use the XMLDataProvider to show some simple Data in ListBoxes. I defined the xmlns Attribute with a value of "" (empty string).

For example:

<XmlDataProvider x:Key="KlischeeTexte" XPath="Items">
    <x:XData>
        <Items xmlns="">
            <Item Wert="0" Beschreibung="&lt;selection&gt;" />
            <Item Wert="1" Beschreibung="Text 1" />
            <Item Wert="2" Beschreibung="Text 2"/>
            <Item Wert="3" Beschreibung="Text 3" />
        </Items>
    </x:XData>
</XmlDataProvider>

I still get the error "System.Windows.Data Error: 49 : XmlDataProvider has inline XML that does not explicitly set its XmlNamespace (xmlns="")." in the output window, but can run my application and I can see the data in the listbox.

But I have another problem in my application. Some Bindings which (seem to) occur after this error do not work. I am able to get those affected bindings to work, when I close the view (I use prism) and load the view again. Now I get still the Error 49 but my binding work.

Is there something I am doing wrong? Or is there an alternative to XmlDataProvider? I just need a method to define some simple data for display and selection purpose in a simple manner!

w.malgadey
  • 31
  • 5

0 Answers0