示例#1
1
        /// <summary>Initializes a new instance of the <see cref="Shell"/> class.</summary>
        /// <param name="msgBoxService">The msg Box Service.</param>
        /// <param name="eventAggregator"></param>
        /// <param name="commands">The commands.</param>
        /// <param name="fileManagerService">The file Manager Service.</param>
        /// <param name="buttonsCommands">The buttons Commands.</param>
        public Shell(
            IMessageBoxService msgBoxService,
            IEventAggregator eventAggregator,
            List<IToolbarCommand> commands,
            IFileManagerService fileManagerService,
            List<IButtonsCommand> buttonsCommands)
        {
            this.InitializeComponent();

            // Wire up our view presenters
            var toolbarButtonsView = new ToolbarView { Dock = DockStyle.Top };
            var toolbarViewPresenter = new ToolbarPresenter(toolbarButtonsView, commands);

            var buttonCommandView = new ButtonView { Dock = DockStyle.Bottom };
            var buttonCommandViewPresenter = new ButtonsPresenter(buttonCommandView, buttonsCommands);

            var levelsTreeView = new LevelsView { Dock = DockStyle.Fill };
            var levelsTreeViewPresenter = new LevelsViewPresenter(levelsTreeView, msgBoxService, eventAggregator);

            var infoView = new InformationView { Dock = DockStyle.Fill };
            var inforViewPresenter = new InformationViewPresenter(infoView);

            // Wire up our views
            this.toolbarView = toolbarButtonsView;
            this.buttonView = buttonCommandView;
            this.levelsView = levelsTreeView;
            this.informationView = infoView;

            // Wire up our event messaging
            this.aggregator = eventAggregator;
            this.aggregator.GetEvent<CloseShellMessage>().Subscribe(this.OnCloseShell);

            // Place the views in the correct regions
            this.InjectViews();
        }
示例#2
0
        /// <summary>Initializes a new instance of the <see cref="Shell"/> class.</summary>
        /// <param name="msgBoxService">The msg Box Service.</param>
        /// <param name="eventAggregator"></param>
        /// <param name="commands">The commands.</param>
        /// <param name="fileManagerService">The file Manager Service.</param>
        /// <param name="buttonsCommands">The buttons Commands.</param>
        public Shell(
            IMessageBoxService msgBoxService,
            IEventAggregator eventAggregator,
            List <IToolbarCommand> commands,
            IFileManagerService fileManagerService,
            List <IButtonsCommand> buttonsCommands)
        {
            this.InitializeComponent();

            // Wire up our view presenters
            var toolbarButtonsView = new ToolbarView {
                Dock = DockStyle.Top
            };
            var toolbarViewPresenter = new ToolbarPresenter(toolbarButtonsView, commands);

            var buttonCommandView = new ButtonView {
                Dock = DockStyle.Bottom
            };
            var buttonCommandViewPresenter = new ButtonsPresenter(buttonCommandView, buttonsCommands);

            var levelsTreeView = new LevelsView {
                Dock = DockStyle.Fill
            };
            var levelsTreeViewPresenter = new LevelsViewPresenter(levelsTreeView, msgBoxService, eventAggregator);

            var infoView = new InformationView {
                Dock = DockStyle.Fill
            };
            var inforViewPresenter = new InformationViewPresenter(infoView);

            // Wire up our views
            this.toolbarView     = toolbarButtonsView;
            this.buttonView      = buttonCommandView;
            this.levelsView      = levelsTreeView;
            this.informationView = infoView;

            // Wire up our event messaging
            this.aggregator = eventAggregator;
            this.aggregator.GetEvent <CloseShellMessage>().Subscribe(this.OnCloseShell);

            // Place the views in the correct regions
            this.InjectViews();
        }