namespace Launcher.Client.Avalonia.GUI; public partial class ProgramSettingsPanelItem : UserControl { public static readonly StyledProperty SettingKeyProp = AvaloniaProperty.Register( "SettingKey"); public string SettingKey { get => GetValue(SettingKeyProp); set => SetValue(SettingKeyProp, value); //TODO deal with textblock size /*KeyLabel.ToolTip = new ToolTip { Content = value, Foreground = App.MyWhite, Background = App.MySoftDark };*/ } public static readonly StyledProperty SettingValueProp = AvaloniaProperty.Register("SettingValue"); public string SettingValue { get => GetValue(SettingValueProp); set => SetValue(SettingValueProp, value); } public event Action UpdatedEvent; public ProgramSettingsPanelItem() => InitializeComponent(); public ProgramSettingsPanelItem(string key, string value) { InitializeComponent(); SettingKey = key; SettingValue = value; //TODO invoke UpdatedEvent only when focus changed ValueBox.TextInput += (_,_)=> UpdatedEvent?.Invoke(this); } }