添加项目文件。

This commit is contained in:
hsc
2025-12-18 17:26:20 +08:00
parent 942fef0e13
commit 69aaa5c4e5
40 changed files with 2053 additions and 0 deletions

View File

@@ -0,0 +1,36 @@
using System;
using System.Collections.Generic;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Data;
namespace BaseFrame.Converters
{
public class BooleanToVisibilityConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
bool input = value is bool b && b;
bool invert = parameter?.ToString()?.ToLower() == "invert";
if (invert)
input = !input;
return input ? Visibility.Visible : Visibility.Collapsed;
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
bool output = value is Visibility v && v == Visibility.Visible;
bool invert = parameter?.ToString()?.ToLower() == "invert";
if (invert)
output = !output;
return output;
}
}
}