I have found a walkaround solution for this issue. The XmlDataProvider was removed from the viewmodel,and was given to the resources:
<window.resources>
<XmlDataProvider x:Key="Lang" Source="Test.xml" XPath="Root/test1" />
</window.resources>
Lets say the viewmodel like this:
class ViewModel : INotifyPropertyChanged
{
private bool _PropEnabled;
public bool PropEnabled
{
get { return _PropEnabled; }
set { _PropEnabled = value; OnPropertyChanged(); }
...
}
}
Now the binding could be accomplished:
<Label Content="{Binding Source={StaticResource ResourceKey=Lang}, XPath='test11'}" IsEnabled="{Binding PropEnabled}" ></Label>
So the XML and the view can be use for binding in the same time. The
Content is binded to the XML, but the
IsEnabled property is binded to the viewmodel.
I have to highlight this is only a workaround for my problem, but how to merge multiple viewmodels is still unclean for me.