Major upgrade
This commit is contained in:
41
Source/Program/GUI/ViewModel/ManualWindowViewModel.cs
Normal file
41
Source/Program/GUI/ViewModel/ManualWindowViewModel.cs
Normal file
@@ -0,0 +1,41 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.ObjectModel;
|
||||
using System.Threading;
|
||||
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using ProgramLib.GUI.Model;
|
||||
|
||||
namespace ProgramGui.GUI.ViewModel
|
||||
{
|
||||
internal partial class ManualWindowViewModel : ObservableObject
|
||||
{
|
||||
public enum Images
|
||||
{
|
||||
LED_ON,
|
||||
LED_OFF
|
||||
}
|
||||
|
||||
public Dictionary<Images, string> _imageToResourcePathDict;
|
||||
|
||||
public ObservableCollection<CoeMessageDataModel> _coeMessageDataItems { get; set; }
|
||||
|
||||
public ObservableCollection<PowerModuleDataModel> _poweredModuleDataItems { get; set; }
|
||||
|
||||
public ObservableCollection<PowerModuleDataModel> _powerModuleComboBoxDataItems { get; set; }
|
||||
|
||||
private Semaphore _poweredModuleDataItemsSemObj = new Semaphore(initialCount: 1, maximumCount: 1);
|
||||
|
||||
public ManualWindowViewModel()
|
||||
{
|
||||
_coeMessageDataItems = new ObservableCollection<CoeMessageDataModel>();
|
||||
|
||||
_imageToResourcePathDict = new Dictionary<Images, string>()
|
||||
{
|
||||
{Images.LED_ON, @$"pack://application:,,,/{GetType().Assembly.GetName().Name};component/Resources/Images/green-led.png" },
|
||||
{Images.LED_OFF, @$"pack://application:,,,/{GetType().Assembly.GetName().Name};component/Resources/Images/black-led.png" }
|
||||
};
|
||||
}
|
||||
|
||||
public Semaphore GetPoweredModuleDataItemsSem() { return _poweredModuleDataItemsSemObj; }
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user