You can only bind to non-static public properties (not fields). But you can use any "carrier" for those properties (so you are not forced to have those properties in the ViewModel). Let's see...
<Resources>
<LocaleHelperWrapper x:Key="Wrapper"/>
</Resources>
<ComboBox ItemsSource="{Binding Path=FriendlyNames,
Source={StaticResource Wrapper}}"/>
And the wrapper code:
public class LocaleHelperWrapper
{
public Dictionary<string, string> FriendlyNames
{
get { return LocaleHelper.FriendlyNames; }
}
}
[Edit] The ComboBox
supports DisplayMemberPath
and SelectedValue
. Assuming you want to use the ComboBox to select the Key
and display the Value
of you Dictionary's KeyValuePairs
:
<ComboBox
DisplayMemberPath="Value"
SelectedValuePath="Key"
SelectedValue="{Binding Path=MySelectionViewModel.SelectedKey, Mode=TwoWay}"
ItemsSource="..."/>