2026-06-05 13:44:39 +09:00

58 lines
1.6 KiB
C#

/*
* Copyright (c) 2022 LG Electronics Inc.
* SPDX-License-Identifier: LicenseRef-LGE-Proprietary
*/
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 AuroraUIComponent.UserControls
{
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();
}
}
}