2026-01-26 18:56:53 +09:00

54 lines
1.4 KiB
C#

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 Aurora.View
{
internal class PaddingConverter : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
var unit = (string)value;
if (string.IsNullOrEmpty(unit)) {
return UCCommonDef.UCKeyValueCommon.DEFAULT_TEXTBOX_PADDING;
}
return new Thickness(2, 0, 15, 0);
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
return parameter;
}
}
internal class MouseVisibilityConverter : IMultiValueConverter
{
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
{
bool isReadOnly = (bool)values[0];
bool showKeypad = (bool)values[1];
if (!showKeypad) {
return Visibility.Collapsed;
}
if (isReadOnly) {
return Visibility.Collapsed;
}
return Visibility.Visible;
}
public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
}