how to bind xmldataprovider in MVVM? RRS feed

  • General discussion

  • Hello everyone,

    I am new in MVVM. I am trying to binding XmlDataProvider with a treeview. I have a XmlProvider in my view,and i want to bind its source property with a another property which is situated in my viewmodel class ie Filepath property. For that i am writing this code

    <XmlDataProvider x:Key="xmlDataProvider" Source="{Binding FilePath}" />

    but it shows this error

    A Binding can not be set on Source property of type XmlDataProvider.Binding can only be set on  Dependency Property of Dependecy Object.

    So how can I bind that Source of XmlDataProvider with the property which is in ViewModel?Is there any other solution for bind that property into View??

    • Edited by Apoorv_Jain Thursday, September 23, 2010 9:33 AM
    Thursday, September 23, 2010 8:39 AM

All replies

  • How to bind XmlDataProvider.Source to MVVM property

    XMLDataProvider MVVM

    Some addition links are given below

    How to: Create and Bind to an ObservableCollection

    vM Workshop: Model View ViewModel (MVVM) and the Presentation Model Pattern in 5 UI Platforms

    MVVM Pattern Test Command like Behavior Using HugeFlow DLL

    MVVM, a WPF UI Design Pattern - Essential Edition

    Thursday, September 23, 2010 8:54 AM