Esempio n. 1
0
 public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
 {
     if (values.Length == 2)
     {
         IIconProvider iconProvider = values[0] as IIconProvider;
         object        key          = values[1];
         if (iconProvider != null && key != null)
         {
             return((object)iconProvider.GetIconAsImageSource(key, parameter));
         }
     }
     return((object)null);
 }
        public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
        {
            if (values.Length == 2)
            {
                IIconProvider iconProvider   = values[0] as IIconProvider;
                object        objectToLookUp = values[1];
                if (iconProvider != null && objectToLookUp != null)
                {
                    return(iconProvider.GetIconAsImageSource(objectToLookUp, parameter));
                }
            }

            return(null);
        }