Beispiel #1
0
        public Shell(
            ShellViewModel shellViewModel, 
            IEventAggregator eventAggregator, 
            IMainMenuApplicationService mainMenuApplicationService,
            ILayoutDataFactory layoutDataFactory,
            ILayoutApplicationService layoutApplicationService,
            IRestBoxStateService restBoxStateService)
        {
            this.mainMenuApplicationService = mainMenuApplicationService;
            this.layoutDataFactory = layoutDataFactory;
            this.layoutApplicationService = layoutApplicationService;
            this.restBoxStateService = restBoxStateService;
            this.eventAggregator = eventAggregator;
            this.shellViewModel = shellViewModel;
            DataContext = shellViewModel;
            shellViewModel.ApplicationTitle = "REST Box";

            InitializeComponent();

            layoutApplicationService.Load(dockingManager);

            httpRequestFilesLayout = GetLayoutAnchorableById("HttpRequestFilesLayoutId");
            environmentsLayout = GetLayoutAnchorableById("EnvironmentsLayoutId");
            requestExtensions = GetLayoutAnchorableById("RequestExtensionsId");
            sequenceFiles = GetLayoutAnchorableById("SequenceFilesId");
            interceptorFiles = GetLayoutAnchorableById("InterceptorFilesId");

            httpRequestFilesLayout.Content = ServiceLocator.Current.GetInstance<HttpRequestFiles>();
            environmentsLayout.Content = ServiceLocator.Current.GetInstance<RequestEnvironments>();
            requestExtensions.Content = ServiceLocator.Current.GetInstance<RequestExtensions>();
            sequenceFiles.Content = ServiceLocator.Current.GetInstance<HttpRequestSequenceFiles>();
            interceptorFiles.Content = ServiceLocator.Current.GetInstance<HttpInterceptorFiles>();

            eventAggregator.GetEvent<AddInputBindingEvent>().Subscribe(AddInputBinding);
            eventAggregator.GetEvent<RemoveInputBindingEvent>().Subscribe(RemoveInputBindings);
            eventAggregator.GetEvent<RemoveTabEvent>().Subscribe(RemoveTabById);
            eventAggregator.GetEvent<IsDirtyEvent>().Subscribe(IsDirtyHandler);

            eventAggregator.GetEvent<AddLayoutDocumentEvent>().Subscribe(AddLayoutDocument);
            eventAggregator.GetEvent<UpdateTabTitleEvent>().Subscribe(UpdateTabTitle);
            eventAggregator.GetEvent<GetLayoutDataEvent>().Subscribe(GetLayoutContent);

            eventAggregator.GetEvent<ShowErrorEvent>().Subscribe(ShowError);

            eventAggregator.GetEvent<ShowLayoutEvent>().Subscribe(ShowLayout);
            eventAggregator.GetEvent<UpdateViewMenuItemChecksEvent>().Subscribe(UpdateViewMenuChecks);

            eventAggregator.GetEvent<SaveAllEvent>().Subscribe(SaveAllHandler);

            eventAggregator.GetEvent<ResetLayoutEvent>().Subscribe(ResetLayoutOnRestart);
            eventAggregator.GetEvent<SaveRestBoxStateEvent>().Subscribe(SaveRestBoxState);
            eventAggregator.GetEvent<CreateStartPageEvent>().Subscribe(CreateStartPage);
            eventAggregator.GetEvent<UpdateStatusBarEvent>().Subscribe(UpdateStatusBar);

            Closing += OnClosing;
            CreateStartPage(true);
        }
        public StartPage(IMainMenuApplicationService mainMenuApplicationService, StartPageViewModel startPageViewModel)
        {
            this.mainMenuApplicationService = mainMenuApplicationService;
            DataContext = startPageViewModel;

            InitializeComponent();

            StartPageWebBrowser.Navigate(new Uri("http://www.google.co.uk"));
        }
Beispiel #3
0
 public MainMenuController(IMainMenuApplicationService mainMenuApplicationService)
 {
     _mainMenuApplicationService = mainMenuApplicationService;
 }