2023-06-16 15:48:27 +08:00
|
|
|
using System;
|
|
|
|
using System.Globalization;
|
|
|
|
using System.Windows.Data;
|
2023-09-05 00:12:08 +08:00
|
|
|
using MECF.Framework.Common.Account;
|
2023-06-16 15:48:27 +08:00
|
|
|
using MECF.Framework.UI.Client.ClientBase;
|
|
|
|
|
|
|
|
namespace MECF.Framework.UI.Client.RecipeEditorLib.Converters;
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
/// 配方参数权限转换为IsEnabled属性值的转换器。
|
|
|
|
/// </summary>
|
|
|
|
public class PermissionToIsEnabledConverter : IValueConverter
|
|
|
|
{
|
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
|
|
{
|
|
|
|
if (value is MenuPermissionEnum perm)
|
|
|
|
return perm == MenuPermissionEnum.MP_READ_WRITE;
|
|
|
|
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
|
|
{
|
|
|
|
throw new NotImplementedException();
|
|
|
|
}
|
|
|
|
}
|