Hi to all out there...
I facing one problem which is cannot set the new image:
Does my code correct?
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
var str = value.ToString();
if (str == "income")
return new BitmapImage(new Uri("/images/add.png", UriKind.Relative));
if (str == "Expenses")
{
return new BitmapImage(new Uri("/HouseWivesSavior;component/images/add.png"));
}
return null;
}
You have to make sure that the image files have their
Build Action
set toResource
as shown for example here. Then you would have to properly create their Pack URIs, likeand