1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-22 13:50:14 +00:00
msfs-popout-panel-manager/DomainModel/Profile/FloatingPanel.cs
2024-03-04 22:01:13 -05:00

38 lines
1,009 B
C#

using System;
using MSFSPopoutPanelManager.Shared;
using Newtonsoft.Json;
namespace MSFSPopoutPanelManager.DomainModel.Profile
{
public class FloatingPanel : ObservableObject
{
public FloatingPanel()
{
PropertyChanged += FloatingPanel_PropertyChanged; ;
}
private void FloatingPanel_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
{
var arg = e as PropertyChangedExtendedEventArgs;
if (arg?.PropertyName != nameof(IsEnabled) || IsEnabled)
return;
KeyboardBinding = null;
IsHiddenOnStart = false;
}
public bool IsEnabled { get; set; }
public string KeyboardBinding { get; set; }
public bool IsHiddenOnStart { get; set; }
[JsonIgnore]
public bool IsDetectingKeystroke { get; set; }
[JsonIgnore]
public bool HasKeyboardBinding => !string.IsNullOrEmpty(KeyboardBinding);
}
}