This repository has been archived on 2024-01-02. You can view files and clone it, but cannot push or open issues or pull requests.
2023-01-13 10:57:37 +08:00
|
|
|
|
using System;
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
using System.Windows.Data;
|
2023-03-30 15:12:20 +08:00
|
|
|
|
using MECF.Framework.UI.Client.RecipeEditorLib.RecipeModel.Params;
|
2023-01-13 10:57:37 +08:00
|
|
|
|
|
|
|
|
|
namespace SicUI.Models.RecipeEditors
|
|
|
|
|
{
|
|
|
|
|
public class ParamToCellTooltipConverter : IValueConverter
|
|
|
|
|
{
|
|
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
|
|
|
{
|
|
|
|
|
if (!(value is IParam param))
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
if (!param.IsValidated)
|
|
|
|
|
return param.ValidationError;
|
|
|
|
|
|
|
|
|
|
if (param is DoubleParam dblParam)
|
|
|
|
|
return $"{dblParam.Minimun} - {dblParam.Maximun}";
|
|
|
|
|
|
|
|
|
|
return null;
|
|
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
|
|
|
{
|
|
|
|
|
throw new NotImplementedException();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|