mirror of
https://gitee.com/langsisi_admin/serein-flow
synced 2026-03-15 22:16:34 +08:00
43 lines
1.2 KiB
C#
43 lines
1.2 KiB
C#
using Avalonia.Data;
|
|
using Avalonia.Data.Converters;
|
|
using Serein.Library;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Serein.Workbench.Avalonia.Converters
|
|
{
|
|
internal class IsVisibleOfParameterConverter : IValueConverter
|
|
{
|
|
public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
{
|
|
|
|
if(value is ParameterDetails pd)
|
|
{
|
|
|
|
if (pd.InputType == ParameterValueInputType.Input)
|
|
{
|
|
|
|
return false;
|
|
|
|
}
|
|
else
|
|
{
|
|
return true;
|
|
}
|
|
}
|
|
|
|
// converter used for the wrong type
|
|
return new BindingNotification(new InvalidCastException(), BindingErrorType.Error);
|
|
}
|
|
|
|
public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
|
|
{
|
|
throw new NotImplementedException();
|
|
}
|
|
}
|
|
}
|