mvvm - How to bind ResourceDictionary to ViewModelProperty -
i have viewmodel mainwindow property uriresource. how can bind property resourcedictionary? have tried code:
<window.resources> <resourcedictionary source="{binding uriresource}"> </resourcedictionary> </window.resources>
but error: objects added idictionary must have key attribute or other type of key associated them.
this how app.settings like:
<application x:class="pcgtools.app" ... <application.resources> <resourcedictionary> <resourcedictionary.mergeddictionaries> <resourcedictionary source="....." /> </resourcedictionary.mergeddictionaries> <local:enumtobooleanconverter x:key="enumtobooleanconverter"/> <booleantovisibilityconverter x:key="booltovisibilityconverter"/> <res:strings x:key="locstrings"/> </resourcedictionary> </application.resources> </application>
probably need add together x:key="....."
mvvm binding
No comments:
Post a Comment