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 OnListTableScreensExecute(string obj) { if (_tableScreenListViewModel == null) _tableScreenListViewModel = new TableScreenListViewModel(); CommonEventPublisher.PublishViewAddedEvent(_tableScreenListViewModel); }