mirror of
https://gitee.com/akwkevin/aistudio.-wpf.-diagram
synced 2026-04-12 12:16:37 +08:00
mind 有点样子了
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user