Hello,
I've got a question, I've got some SL project of a unique solution that shares the most of images, I wished to bind the Grid.BackGround.ImageBrush using a {Binding}, but I got a AG_E_PARSER_BAD_PROPERTY_VALUE , the only way I've found is to set the ImageSource to a fake image, then adding the ImageFailed event and here set the ImageSource
For the classic images i use :
where ImageLocator is :
and ImageRepository is :
Is it best to have a DO class that contains all the images or can I achieve this in that way? I wish to have the SL application to point to http://<mysitename>/images/{picture} without having to hardcode the mysite name in XAML
Thanks
I've got a question, I've got some SL project of a unique solution that shares the most of images, I wished to bind the Grid.BackGround.ImageBrush using a {Binding}, but I got a AG_E_PARSER_BAD_PROPERTY_VALUE , the only way I've found is to set the ImageSource to a fake image, then adding the ImageFailed event and here set the ImageSource
For the classic images i use :
<Image Source="{Binding ICO_SEARCH, Converter={StaticResource ImageLocator}}" Height="20" Width="20" /> |
where ImageLocator is :
public class ImageLocatorConverter : IValueConverter |
{ |
#region IValueConverter Members |
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) |
{ |
string imageName = string.Format("./Images/{0}", value); |
Uri baseUri = ProxyFactory.GetUriFromLocalPath(); |
Uri uri = new Uri(baseUri, imageName); |
BitmapImage img = new BitmapImage(uri); |
return img; |
} |
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) |
{ |
throw new NotImplementedException(); |
} |
#endregion |
} |
and ImageRepository is :
public class ImageRepository |
{ |
public string IMG_MIFID { get { return "mifid.png"; } private set { } } |
public string IMG_DISALL { get { return "forex.jpg"; } private set { } } |
public string IMG_MAP { get { return "Mondoaparte.jpg"; } private set { } } |
public string IMG_UTILITY { get { return "utility.png"; } private set { } } |
public string ICO_XLS { get { return "icon_xls.jpg"; } private set { } } |
public string ICO_INSERT { get { return "insert.png"; } private set { } } |
public string ICO_SEARCH { get { return "search.png"; } private set { } } |
public string ICO_DELETE { get { return "delete_16x16.png"; } private set { } } |
public string IMG_BACKGROUND { get { return "background.jpg"; } private set { } } |
public static string PROVA { get { return "background.jpg"; } private set { } } |
} |
Is it best to have a DO class that contains all the images or can I achieve this in that way? I wish to have the SL application to point to http://<mysitename>/images/{picture} without having to hardcode the mysite name in XAML
Thanks