public DataFilterViewModel() { ClearCommond = new RelayCommand(DoClearCommond); StartFilterCommond = new RelayCommand(DoStartFilterCommond); BookmarkSource = new Dictionary<int, string>() { {-2, Languagekeys.BookmarkAll }, {0, Languagekeys.BookmarkYes }, {-1, Languagekeys.BookmarkNone }, }; DataStateSource = new Dictionary<EnumDataState, string>() { { EnumDataState.None, Languagekeys.DataStateAll }, { EnumDataState.Normal,Languagekeys.DataStateNormal }, { EnumDataState.Deleted ,Languagekeys.DataStateDelete } }; KeywordTypeSource = new Dictionary<int, string>() { {0, Languagekeys.Keyword }, {1, Languagekeys.ZhengZe}, }; MessageAggregation.RegisterGeneralMsg<ObservableCollection<DataExtactionItem>>(this, MessageKeys.SetDataListKey, SetDataListKey); MessageAggregation.RegisterGeneralMsg<object>(this, MessageKeys.DataLoadedCompletedKey, b=> OnDataLoadedCompleted()); //设置智能预警参数 MessageAggregation.RegisterGeneralMsg<List<Inspection>>(this, MessageKeys.InspectionKey, b => { IsInspection = true; InspectionList.Clear(); InspectionList.AddRange(b.Parameters.Select(i => new InspectionItem() { Id = i.ID, Name = LanguageHelper.LanguageManager.Type == Framework.Language.LanguageType.En ? i.CategoryEn : i.CategoryCn, Icon = null })); //SelectedInspectionItem = InspectionList.FirstOrDefault(); }); }
public EarlyWarningViewModel() { SelecedAppChanged = new RelayCommand <object>(DoSelecedAppChanged); DeleteDataCommond = new RelayCommand <object>(DoDeleteDataCommond); MessageAggregation.RegisterGeneralMsg <bool>(this, MessageKeys.StartFilterKey, StartFilter); _MessageBox = IocManagerSingle.Instance.GetPart <IMessageBox>(); }
public DeviceListViewModel() { _selectDeviceCommandProxy = new ProxyRelayCommand(SelectDevice); CloseCommand = new GalaSoft.MvvmLight.CommandWpf.RelayCommand <DeviceExtractionAdorner>(Close); _moveToCommandProxy = new ProxyRelayCommand <DeviceExtractionAdorner>(MoveTo); _deleteCommandProxy = new ProxyRelayCommand <DeviceExtractionAdorner>(Delete); PopupCommand = new GalaSoft.MvvmLight.CommandWpf.RelayCommand <DeviceExtractionAdorner>(Popup); MessageAggregation.RegisterGeneralMsg <object>(this, ExportKeys.DeviceWindowClosedMsg, (d) => BackToList(d.Parameters as DeviceExtractionAdorner)); }