Major upgrade

This commit is contained in:
Duc
2025-10-24 15:18:11 -07:00
parent fd85735c93
commit ce583d1664
478 changed files with 237518 additions and 47610 deletions

View File

@@ -1,10 +1,9 @@
using CommunityToolkit.Mvvm.ComponentModel;
using ProgramLib.GUI.Model;
using System;
using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Windows;
using System.Windows.Threading;
using CommunityToolkit.Mvvm.ComponentModel;
using ProgramLib.GUI.Model;
namespace ProgramLib.GUI.ViewModel
{
@@ -17,38 +16,39 @@ namespace ProgramLib.GUI.ViewModel
FAIL_CHECK
}
public Dictionary<Images, string> ImageToResourcePathDict
{
public Dictionary<Images, string> ImageToResourcePathDict
{
get
{
return _imageToResourcePathDict;
}
private set { }
private set { }
}
private Dictionary<Images, string> _imageToResourcePathDict = new Dictionary<Images, string>()
{
{Images.PASS_CHECK, @"pack://application:,,,/Program;component/Resources/Images/green-check-mark.png" },
{Images.FAIL_CHECK, @"pack://application:,,,/Program;component/Resources/Images/red-cross-mark.png" }
};
private Dictionary<Images, string> _imageToResourcePathDict;
#region Data Bindings
public ObservableCollection<ImpedanceDataModel> _listviewImpedanceDatatems { get; set; }
public ObservableCollection<ImpedanceDataModel> _listviewImpedanceDataItems { get; set; }
#endregion Data Bindings
public ImpedanceCheckWindowViewModel(Window window)
{
_window = window;
_listviewImpedanceDatatems = new ObservableCollection<ImpedanceDataModel>();
_listviewImpedanceDataItems = new ObservableCollection<ImpedanceDataModel>();
_imageToResourcePathDict = new Dictionary<Images, string>()
{
{Images.PASS_CHECK, @$"pack://application:,,,/{GetType().Assembly.GetName().Name};component/Resources/Images/green-check-mark.png" },
{Images.FAIL_CHECK, @$"pack://application:,,,/{GetType().Assembly.GetName().Name};component/Resources/Images/red-cross-mark.png" }
};
}
public void AddData(ImpedanceDataModel item)
{
_window.Dispatcher.Invoke((Action)delegate
{
_listviewImpedanceDatatems.Add(item);
_listviewImpedanceDataItems.Add(item);
});
}
@@ -56,7 +56,7 @@ namespace ProgramLib.GUI.ViewModel
{
_window.Dispatcher.Invoke((Action)delegate
{
_listviewImpedanceDatatems.Clear();
_listviewImpedanceDataItems.Clear();
});
}
}