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 ResourceSearchView(ResourceSearchViewModel viewModel)
 {
     DataContext = viewModel;
     viewModel.SelectedResourceTemplateChanged += viewModel_SelectedAccountTemplateChanged;
     InitializeComponent();
 }
예제 #4
0
 public ResourceSearchView(ResourceSearchViewModel viewModel)
 {
     DataContext = viewModel;
     viewModel.SelectedResourceTypeChanged += viewModel_SelectedAccountTypeChanged;
     InitializeComponent();
 }