public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { try { if (value is string) { string s = (string)value; if (s.Length == 0) { return(null); } return(IconCache.GetImage(s)); } if (value is Uri) { return(IconCache.GetImage((Uri)value)); } if (value is User) { User user = (User)value; return(IconCache.GetImage(user.ID, user.ProfileImageUrl)); } } catch {} return(null); }
void Render () { if (Owner == null) { Source = null; return; } Status s = Owner.DataContext as Status; if (s == null) return; if (s.RetweetedStatus != null) s = s.RetweetedStatus; Source = IconCache.GetImage (s.User.ID, s.User.ProfileImageUrl); }