protected override void OnInitialization() { _regionManager.RegisterViewWithRegion(RegionNames.MainRegion, typeof(TableSelectorView)); PermissionRegistry.RegisterPermission(PermissionNames.OpenTables, PermissionCategories.Navigation, Resources.CanOpenTableList); PermissionRegistry.RegisterPermission(PermissionNames.ChangeTable, PermissionCategories.Ticket, Resources.CanChangeTable); EventServiceFactory.EventService.GetEvent <GenericEvent <Department> >().Subscribe(x => { if (x.Topic == EventTopicNames.SelectTable) { ActivateTableView(); } }); EventServiceFactory.EventService.GetEvent <GenericEvent <VisibleViewModelBase> >().Subscribe( x => { if (x.Topic == EventTopicNames.ViewClosed) { if (x.Value == _tableListViewModel) { _tableListViewModel = null; } if (x.Value == _tableScreenListViewModel) { _tableScreenListViewModel = null; } } } ); }
private void OnListTablesExecute(string obj) { if (_tableListViewModel == null) { _tableListViewModel = new TableListViewModel(); } CommonEventPublisher.PublishViewAddedEvent(_tableListViewModel); }