/* * Copyright (c) 2022 LG Electronics Inc. * SPDX-License-Identifier: LicenseRef-LGE-Proprietary */ using AuroraUIComponent.UserControls.KeyValueBase; using System.Windows; namespace AuroraUIComponent.UserControls { /// /// Interaction logic for UCKeyValueString.xaml /// 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); } } } }