I have added a Dictionary property named Xy in the user control I developed. The dictionary type is Dictionary<int, string>
While using the user control in a wpf application, I need to add these items to the dictionary from the xaml file of the application.
0,"a.bmp"
1,"b.bmp"
How can I do this?
The user control code is given below
public partial class UserControl1 : UserControl
{
private Dictionary<int, string> xy = new Dictionary<int, string>();
public Dictionary<int, string> Xy
{
get
{
return xy;
}
set
{
xy = value;
}
}
}
Edit
The basic idea is to add a set of value, image name pairs to the disctionary from the xaml file. Sample pairs are given below
0,"a.bmp"
1,"b.bmp"
If value 0 is set some property, show image a.bmp
If value 1 is set some property, show image b.bmp
Is that possible?