12345678910111213141516171819202122232425262728293031323334353637 |
- using FISLib.Consultation;
- using System;
- using System.Globalization;
- using System.Windows.Data;
- using System.Windows.Markup;
- namespace FISSDKDemo.Extensions
- {
- class InspectionItemDescriptionConverterExtension : MarkupExtension
- {
- [ThreadStatic]
- private static InspectionItemDescriptionConverter _converter;
- public override object ProvideValue(IServiceProvider serviceProvider)
- {
- return _converter ?? (_converter = new InspectionItemDescriptionConverter());
- }
- private class InspectionItemDescriptionConverter : IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
- {
- if (value is FISInspectionItemType fisInspectionItemType)
- {
- return InspectionItemDescriptionGenerator.GetInspectionItemDescription(fisInspectionItemType);
- }
- return string.Empty;
- }
- public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
- {
- throw new NotImplementedException();
- }
- }
- }
- }
|