mind 有点样子了

This commit is contained in:
艾竹
2023-02-19 21:38:28 +08:00
parent 08a4fddfdc
commit ca1ac13a1f
14 changed files with 1993 additions and 246 deletions

View File

@@ -1,24 +1,25 @@
using System;
using System.Windows;
using System.Windows.Data;
namespace AIStudio.Wpf.DiagramDesigner.Converters
{
public class IntToBoolConverter : IValueConverter
public class IntToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (object.Equals(value, 0d))
return false;
if (value == null || object.Equals(value, 0))
return Visibility.Collapsed;
else
return true;
return Visibility.Visible;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (object.Equals(value, false))
return 0d;
if (object.Equals(value, Visibility.Collapsed))
return 0;
else
return 1d;
return 1;
}
}
}