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