1
0
Fork 0
mirror of https://github.com/hawkeye-stan/msfs-popout-panel-manager.git synced 2024-11-22 05:40:11 +00:00
msfs-popout-panel-manager/MainApp/ViewModel/BaseViewModel.cs

59 lines
1.5 KiB
C#
Raw Normal View History

2024-02-28 02:44:21 +00:00
using System;
using System.Windows;
using MSFSPopoutPanelManager.DomainModel.Profile;
using MSFSPopoutPanelManager.Orchestration;
2023-07-12 22:41:31 +00:00
using MSFSPopoutPanelManager.Shared;
namespace MSFSPopoutPanelManager.MainApp.ViewModel
{
public abstract class BaseViewModel : ObservableObject
{
2024-02-28 02:44:21 +00:00
private SharedStorage SharedStorage { get; }
2023-07-12 22:41:31 +00:00
2024-02-28 02:44:21 +00:00
protected const string ROOT_DIALOG_HOST = "RootDialog";
2023-07-12 22:41:31 +00:00
2024-02-28 02:44:21 +00:00
protected BaseViewModel(SharedStorage sharedStorage)
2023-07-12 22:41:31 +00:00
{
2024-02-28 02:44:21 +00:00
SharedStorage = sharedStorage;
InitializeChildPropertyChangeBinding();
}
2023-07-12 22:41:31 +00:00
2024-02-28 02:44:21 +00:00
public AppSettingData AppSettingData => SharedStorage.AppSettingData;
public ProfileData ProfileData
{
get => SharedStorage.ProfileData;
set => SharedStorage.ProfileData = value;
2023-07-12 22:41:31 +00:00
}
2024-02-28 02:44:21 +00:00
public FlightSimData FlightSimData => SharedStorage.FlightSimData;
2023-07-12 22:41:31 +00:00
2024-02-28 02:44:21 +00:00
public UserProfile ActiveProfile => SharedStorage.ProfileData.ActiveProfile;
2023-07-12 22:41:31 +00:00
2024-02-28 02:44:21 +00:00
public IntPtr ApplicationHandle
{
get => SharedStorage.ApplicationHandle;
set => SharedStorage.ApplicationHandle = value;
}
2023-07-12 22:41:31 +00:00
2024-02-28 02:44:21 +00:00
public Window ApplicationWindow
2023-07-12 22:41:31 +00:00
{
2024-02-28 02:44:21 +00:00
get => SharedStorage.ApplicationWindow;
set => SharedStorage.ApplicationWindow = value;
}
2023-07-12 22:41:31 +00:00
2024-02-28 02:44:21 +00:00
public bool LocalCompileOnly
{
get
2023-07-12 22:41:31 +00:00
{
2024-02-28 02:44:21 +00:00
#if LOCAL
return true;
#endif
2023-07-12 22:41:31 +00:00
2024-02-28 02:44:21 +00:00
return false;
2023-07-12 22:41:31 +00:00
}
}
}
}