1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-24 14:50:10 +00:00
msfs-popout-panel-manager/DomainModel/Profile/FloatingPanel.cs
2024-09-17 17:33:23 -04:00

38 lines
1,007 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);
}
}