1234567891011121314151617181920212223242526272829303132333435 |
- using Prism.Events;
- using ProjectManagementSystem.Common.Core;
- using ProjectManagementSystemView.Infrastructure.Events;
- using ProjectManagementSystemView.Infrastructure.Extensions;
- using ProjectManagementSystemView.Infrastructure.Models;
- using PropertyChanged;
- using System;
- using System.Collections.Generic;
- using System.Collections.ObjectModel;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- namespace ProjectManagementSystemView.ViewModels
- {
- [AddINotifyPropertyChangedInterface]
- public class DebugPackViewModel
- {
- public bool IsVisible { get; set; }
- public ObservableCollection<VmPackStation> VmDatas { get; set; } = new ObservableCollection<VmPackStation>();
- public DebugPackViewModel(IEventAggregator eventAggregator)
- {
- eventAggregator.GetEvent<UpdateViewEvent>().Subscribe(UpdateView);
- }
- private void UpdateView()
- {
- if (!IsVisible) return;
- var dataList = PackControl.Instance.StationDictionary.Values.OrderBy(d => d.Id);
- VmDatas.Update(dataList, (s, v) => s.Id == v.Id);
- }
- }
- }
|