Ejemplo n.º 1
0
        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;
                    }
                }
                );
        }
Ejemplo n.º 2
0
 private void OnListTableScreensExecute(string obj)
 {
     if (_tableScreenListViewModel == null)
         _tableScreenListViewModel = new TableScreenListViewModel();
     CommonEventPublisher.PublishViewAddedEvent(_tableScreenListViewModel);
 }