1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-25 23:30:10 +00:00
msfs-popout-panel-manager/DomainModel/Profile/FloatingPanel.cs

39 lines
1,007 B
C#
Raw Permalink Normal View History

2024-03-05 03:01:13 +00:00
using System;
using MSFSPopoutPanelManager.Shared;
2024-03-01 11:28:09 +00:00
using Newtonsoft.Json;
2024-02-29 06:11:56 +00:00
namespace MSFSPopoutPanelManager.DomainModel.Profile
{
public class FloatingPanel : ObservableObject
{
2024-03-05 03:01:13 +00:00
public FloatingPanel()
{
2024-09-17 21:33:23 +00:00
PropertyChanged += FloatingPanel_PropertyChanged;
2024-03-05 03:01:13 +00:00
}
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;
}
2024-02-29 06:11:56 +00:00
public bool IsEnabled { get; set; }
2024-03-03 05:02:21 +00:00
public string KeyboardBinding { get; set; }
2024-03-01 11:28:09 +00:00
2024-03-05 03:01:13 +00:00
public bool IsHiddenOnStart { get; set; }
2024-03-01 11:28:09 +00:00
[JsonIgnore]
public bool IsDetectingKeystroke { get; set; }
2024-03-05 03:01:13 +00:00
[JsonIgnore]
public bool HasKeyboardBinding => !string.IsNullOrEmpty(KeyboardBinding);
2024-02-29 06:11:56 +00:00
}
}