public ResourceSwitcherViewModel(IRegionManager regionManager, ICacheService cacheService, IApplicationState applicationState, IApplicationStateSetter applicationStateSetter,
            ResourceSelectorView resourceSelectorView, ResourceSelectorViewModel resourceSelectorViewModel,
            ResourceSearchView resourceSearchView, ResourceSearchViewModel resourceSearchViewModel,
            ResourceDashboardView resourceDashboardView, ResourceDashboardViewModel resourceDashboardViewModel)
        {
            _regionManager = regionManager;
            _cacheService = cacheService;
            _applicationState = applicationState;
            _applicationStateSetter = applicationStateSetter;
            _resourceSelectorView = resourceSelectorView;
            _resourceSelectorViewModel = resourceSelectorViewModel;
            _resourceSearchView = resourceSearchView;
            _resourceSearchViewModel = resourceSearchViewModel;
            _resourceDashboardView = resourceDashboardView;
            _resourceDashboardViewModel = resourceDashboardViewModel;

            SelectResourceCategoryCommand = new DelegateCommand<ResourceScreen>(OnSelectResourceCategoryExecuted);

            EventServiceFactory.EventService.GetEvent<GenericEvent<EventAggregator>>().Subscribe(
            x =>
            {
                if (x.Topic == EventTopicNames.ResetCache)
                {
                    _resourceScreens = null;
                    _resourceSwitcherButtons = null;
                    RaisePropertyChanged(() => ResourceSwitcherButtons);
                }
            });

            EventServiceFactory.EventService.GetEvent<GenericEvent<EntityOperationRequest<Resource>>>().Subscribe(x =>
            {
                if (x.Topic == EventTopicNames.SelectResource)
                {
                    var ss = UpdateResourceScreens(x.Value);
                    _currentOperationRequest = x.Value;
                    ActivateResourceScreen(ss);
                }
            });
        }
        public ResourceSwitcherViewModel(IRegionManager regionManager, ICacheService cacheService, IApplicationState applicationState, IApplicationStateSetter applicationStateSetter,
                                         ResourceSelectorView resourceSelectorView, ResourceSelectorViewModel resourceSelectorViewModel,
                                         ResourceSearchView resourceSearchView, ResourceSearchViewModel resourceSearchViewModel,
                                         ResourceDashboardView resourceDashboardView, ResourceDashboardViewModel resourceDashboardViewModel)
        {
            _regionManager              = regionManager;
            _cacheService               = cacheService;
            _applicationState           = applicationState;
            _applicationStateSetter     = applicationStateSetter;
            _resourceSelectorView       = resourceSelectorView;
            _resourceSelectorViewModel  = resourceSelectorViewModel;
            _resourceSearchView         = resourceSearchView;
            _resourceSearchViewModel    = resourceSearchViewModel;
            _resourceDashboardView      = resourceDashboardView;
            _resourceDashboardViewModel = resourceDashboardViewModel;

            SelectResourceCategoryCommand = new DelegateCommand <ResourceScreen>(OnSelectResourceCategoryExecuted);

            EventServiceFactory.EventService.GetEvent <GenericEvent <EventAggregator> >().Subscribe(
                x =>
            {
                if (x.Topic == EventTopicNames.ResetCache)
                {
                    _resourceScreens         = null;
                    _resourceSwitcherButtons = null;
                    RaisePropertyChanged(() => ResourceSwitcherButtons);
                }
            });

            EventServiceFactory.EventService.GetEvent <GenericEvent <EntityOperationRequest <Resource> > >().Subscribe(x =>
            {
                if (x.Topic == EventTopicNames.SelectResource)
                {
                    var ss = UpdateResourceScreens(x.Value);
                    _currentOperationRequest = x.Value;
                    ActivateResourceScreen(ss);
                }
            });
        }
 public ResourceDashboardView(ResourceDashboardViewModel viewModel)
 {
     InitializeComponent();
     DataContext = viewModel;
 }
Ejemplo n.º 4
0
 public ResourceDashboardView(ResourceDashboardViewModel viewModel)
 {
     InitializeComponent();
     DataContext = viewModel;
 }