42 lines
1.4 KiB
C#
42 lines
1.4 KiB
C#
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; }
|
|
}
|
|
}
|