2023-04-13 11:51:03 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Collections;
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
using System.Windows.Data;
|
|
|
|
|
|
2023-05-10 16:21:45 +08:00
|
|
|
|
namespace MECF.Framework.UI.Client.RecipeEditorLib.Converters
|
2023-04-13 11:51:03 +08:00
|
|
|
|
{
|
|
|
|
|
public class IsDgSelectionCountEqualsOneConverter : IValueConverter
|
|
|
|
|
{
|
|
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
|
|
|
{
|
|
|
|
|
if (value is IList selection)
|
|
|
|
|
{
|
|
|
|
|
return selection.Count == 1;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|