2026-03-30 17:09:29 +09:00

44 lines
1.3 KiB
C#

/*
* Copyright (c) 2022 LG Electronics Inc.
* SPDX-License-Identifier: LicenseRef-LGE-Proprietary
*/
using AuroraUIComponent.UserControls.KeyValueBase;
using System.Windows;
namespace AuroraUIComponent.UserControls
{
/// <summary>
/// Interaction logic for UCKeyComboBoxOnOff.xaml
/// </summary>
public partial class UCKeyComboBoxOnOff : UCKeyValueBase
{
public static readonly DependencyProperty ValueTextProperty
= DependencyProperty.Register(
nameof(ValueText),
typeof(int),
typeof(UCKeyComboBoxOnOff),
new FrameworkPropertyMetadata(
0,
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault
));
public object ValueText {
get { return GetValue(ValueTextProperty); }
set { SetValue(ValueTextProperty, value); }
}
public UCKeyComboBoxOnOff()
{
InitializeComponent();
}
protected override void KeyTextChanged(string newValue)
{
if (string.IsNullOrEmpty(newValue)) {
// KeyText 가 없으므로, 해당 grid 의 width 를 0 으로 만든다
GridParent.ColumnDefinitions[0].Width = new GridLength(0);
}
}
}
}