I have a static Dictionary
class X { static Dictionary MyDict {get { ... }} }
This Dictionary contains Data i want to
You need to use a converter which will allow you to extract your value out of the Dictionary
via the ConverterParameter
.
public class DictConverter: IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
Dictionary data = (Dictionary)value;
String parameter = (String)parameter;
return data[parameter];
}
}
The XAML would be as follows...
Content="{Binding MyDictProperty, Converter={StaticResource MyDictConverter}, ConverterParameter=foo}"