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

156 lines
6.5 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.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
namespace AuroraUIComponent.UserControls
{
/// <summary>
/// UCLedLightText.xaml에 대한 상호 작용 논리
/// </summary>
public partial class UCLedLightText : UserControl
{
public UCLedLightText()
{
InitializeComponent();
}
public bool LedStatusVal {
get { return (bool)GetValue(LedStatusValProperty); }
set { SetValue(LedStatusValProperty, value); }
}
// Using a DependencyProperty as the backing store for MyProperty. This enables animation, styling, binding, etc...
public static readonly DependencyProperty LedStatusValProperty =
DependencyProperty.Register(nameof(LedStatusVal), typeof(bool), typeof(UCLedLightText), new FrameworkPropertyMetadata(
false,
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
public static readonly DependencyProperty KeyTextProperty
= DependencyProperty.Register(
nameof(KeyText),
typeof(string),
typeof(UCLedLightText),
new FrameworkPropertyMetadata(
string.Empty,
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
public string KeyText {
get { return (string)GetValue(KeyTextProperty); }
set { SetValue(KeyTextProperty, value); }
}
public static readonly DependencyProperty KeyTextSizeProperty
= DependencyProperty.Register(
nameof(KeyTextSize),
typeof(double),
typeof(UCLedLightText),
new FrameworkPropertyMetadata(
UCCommonDef.UCKeyValueCommon.DEFAULT_FONTSIZE_KEY,
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
public double KeyTextSize {
get { return (double)GetValue(KeyTextSizeProperty); }
set { SetValue(KeyTextSizeProperty, value); }
}
public static readonly DependencyProperty KeyTextFgColorProperty
= DependencyProperty.Register(
nameof(KeyTextFgColor),
typeof(SolidColorBrush),
typeof(UCLedLightText),
new FrameworkPropertyMetadata(
(SolidColorBrush)Application.Current.Resources["DefaultKeyTextColor"],
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
public SolidColorBrush KeyTextFgColor {
get { return (SolidColorBrush)GetValue(KeyTextFgColorProperty); }
set { SetValue(KeyTextFgColorProperty, value); }
}
public static readonly DependencyProperty ValueTextFgColorProperty
= DependencyProperty.Register(
nameof(ValueTextFgColor),
typeof(SolidColorBrush),
typeof(UCLedLightText),
new FrameworkPropertyMetadata(
Brushes.White,
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
public SolidColorBrush ValueTextFgColor {
get { return (SolidColorBrush)GetValue(ValueTextFgColorProperty); }
set { SetValue(ValueTextFgColorProperty, value); }
}
public static readonly DependencyProperty KeyTextBgColorProperty
= DependencyProperty.Register(
nameof(KeyTextBgColor),
typeof(SolidColorBrush),
typeof(UCLedLightText),
new FrameworkPropertyMetadata(
Brushes.Transparent,
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
public SolidColorBrush KeyTextBgColor {
get { return (SolidColorBrush)GetValue(KeyTextBgColorProperty); }
set { SetValue(KeyTextBgColorProperty, value); }
}
public static readonly DependencyProperty LEDWidthProperty
= DependencyProperty.Register(
nameof(LEDWidth),
typeof(string),
typeof(UCLedLightText),
new FrameworkPropertyMetadata(
"1*",
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
public string LEDWidth {
get { return (string)GetValue(LEDWidthProperty); }
set { SetValue(LEDWidthProperty, value); }
}
public static readonly DependencyProperty KeyTextWidthProperty
= DependencyProperty.Register(
nameof(KeyTextWidth),
typeof(string),
typeof(UCLedLightText),
new FrameworkPropertyMetadata(
"0",
FrameworkPropertyMetadataOptions.BindsTwoWayByDefault));
public string KeyTextWidth {
get { return (string)GetValue(KeyTextWidthProperty); }
set { SetValue(KeyTextWidthProperty, value); }
}
public static readonly DependencyProperty KeyHorizontalAlignmentProperty
= DependencyProperty.Register(
nameof(KeyHorizontalAlignment),
typeof(HorizontalAlignment),
typeof(UCLedLightText),
new PropertyMetadata(HorizontalAlignment.Left));
public HorizontalAlignment KeyHorizontalAlignment {
get { return (HorizontalAlignment)GetValue(KeyHorizontalAlignmentProperty); }
set { SetValue(KeyHorizontalAlignmentProperty, value); }
}
}
}