添加项目文件。

This commit is contained in:
GG Z
2026-02-28 21:01:57 +08:00
parent 9fe4e5a9aa
commit 7a229067cc
175 changed files with 18060 additions and 0 deletions

View File

@@ -0,0 +1,47 @@
using System.Collections.ObjectModel;
using System.Windows.Data;
using System.Windows.Input;
using Mstn.Toolkit.External;
namespace MSDevTool.ViewModels
{
public class ElementInfoViewModel
{
public ElementInfoViewModel()
{
ECPropValues = [];
var cv = CollectionViewSource.GetDefaultView(ECPropValues);
cv.GroupDescriptions.Add(new PropertyGroupDescription("ECInstanceName"));
ClassPropValues = [];
var cv1 = CollectionViewSource.GetDefaultView(ClassPropValues);
cv1.GroupDescriptions.Add(new PropertyGroupDescription("ClassName"));
}
public ObservableCollection<ECPropValue> ECPropValues { get; set; }
public ObservableCollection<ClassPropValue> ClassPropValues { get; set; }
RelayCommand showElementCommand;
public ICommand ShowObjectCommand => showElementCommand ??= new RelayCommand(ShowObject, b => true);
private void ShowObject(object obj)
{
if (obj is ClassPropValue { PropValue: not null } model)
{
var type = model.PropValue.GetType();
if (type.IsClass || (type.IsValueType && !type.IsEnum && !type.IsPrimitive))
{
var props = SnoopHelpers.GetClassPropDictionary(model.PropValue);
ObjectViewModel viewModel = new ObjectViewModel() { PropValues = props };
ObjectView view = new ObjectView(viewModel);
view.Title = model.PropName;
view.Show();
}
}
}
}
}