コード例 #1
0
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
        {
            BitmapImage returnImage;

            if (value == DependencyProperty.UnsetValue || value == null)
            {
                DXImageInfo a = (DXImageInfo) new DXImageConverter().ConvertFromString("DeleteList_16x16.png");
                returnImage = new BitmapImage(a.MakeUri());
            }

            if ((VariationAction)value == VariationAction.Cancel)
            {
                DXImageInfo a = (DXImageInfo) new DXImageConverter().ConvertFromString("AddFile_16x16.png");
                returnImage = new BitmapImage(a.MakeUri());
            }
            else
            {
                DXImageInfo a = (DXImageInfo) new DXImageConverter().ConvertFromString("DeleteList_16x16.png");
                returnImage = new BitmapImage(a.MakeUri());
            }

            return(returnImage);
        }
        ImageSource GetDXImageSourceByName(string imageName)
        {
            DXImageInfo imageInfo = (DXImageInfo) new DXImageConverter().ConvertFromString(imageName);

            return(new BitmapImage(imageInfo.MakeUri()));
        }