2026-01-26 18:56:53 +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 UCKeyValueString.xaml
/// </summary>
public partial class UCKeyValueString : UCKeyValueBase
{
public static readonly DependencyProperty ValueTextProperty
= DependencyProperty.Register(
nameof(ValueText),
typeof(string),
typeof(UCKeyValueString),
new FrameworkPropertyMetadata(
"",
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault
));
public string ValueText {
get { return (string)GetValue(ValueTextProperty); }
set { SetValue(ValueTextProperty, value); }
}
public UCKeyValueString()
{
InitializeComponent();
}
protected override void KeyTextChanged(string newValue)
{
if (string.IsNullOrEmpty(newValue)) {
// KeyText 가 없으므로, 해당 grid 의 width 를 0 으로 만든다
GridParent.ColumnDefinitions[0].Width = new GridLength(0);
}
}
}
}