1234567891011121314151617181920212223242526272829303132 |
- using MECF.Framework.Common.RecipeCenter;
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using System.Windows.Data;
- using System.Windows.Media;
- using System.Windows.Media.Imaging;
- namespace CyberX8_Themes.Converters
- {
- public class RecipeIconConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- return ((RecipeNodeType)value==RecipeNodeType.Directory) ? GetBitmap("RecipeFolder.png") : ((RecipeNodeType)value == RecipeNodeType.File) ? GetBitmap("RecipeFile.png") : GetBitmap("Exit.png");
- }
- private BitmapImage GetBitmap(string name)
- {
- return new BitmapImage(new Uri($"pack://application:,,,/MECF.Framework.Common;component/Resources/{name}"));
- }
- public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- return null;
- }
- }
- }
|