This is kinda hard to define my question precisely but I’ll try to do my best !
I actually have a lots (hundreds) of classical Bindings like this :
<ComboBox ItemsSource="{Binding Path=FrameNames}"/>
Where FrameNames is a properties of my code-behind.
The thing is that I, now, have to do a binding on a method and I know that this is not the MVVM norm but that’s what I want to do.
The code (that doesn’t work) look like :
<ComboBox ItemsSource="{Binding Path=LocalizationUtil.GetLocales()}"/>
Is there a way to do it ? (even if this is not prely respecting the MVVM pattern !)
(This work if I do it in the code-behind, MyComboBox.Itemsource = LocalizationUtil.GetLocales()
but of course it doesn’t get noticed if there is a change)
You can add a
Localesproperty to your view model and bind to it, like so