2021-07-27 16:15:30 +08:00
|
|
|
|
using System;
|
|
|
|
|
|
using System.Globalization;
|
|
|
|
|
|
using System.Windows.Data;
|
|
|
|
|
|
using System.Windows.Markup;
|
|
|
|
|
|
|
2022-10-28 22:45:39 +08:00
|
|
|
|
namespace AIStudio.Wpf.DiagramDesigner
|
2021-07-27 16:15:30 +08:00
|
|
|
|
{
|
|
|
|
|
|
public class InvertBoolConverter : MarkupExtension, IValueConverter
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
|
|
|
|
/// <summary>
|
|
|
|
|
|
/// Returns the value for the target property of this markup extension.
|
|
|
|
|
|
/// </summary>
|
|
|
|
|
|
/// <param name="serviceProvider">Object that can provide services for the markup extension.</param>
|
|
|
|
|
|
/// <returns>Reference to the instance of this Int32IndexToNumberConverter.</returns>
|
|
|
|
|
|
public override object ProvideValue(IServiceProvider serviceProvider)
|
|
|
|
|
|
{
|
|
|
|
|
|
return this;
|
|
|
|
|
|
}
|
|
|
|
|
|
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
|
|
|
|
|
|
{
|
|
|
|
|
|
return !(bool)value;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
|
|
|
|
|
|
{
|
|
|
|
|
|
return !(bool)value;
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|
|
|
|
|
|
}
|