public ProposalsListViewModel(
            [Import]IBackgroundExecutor executor,
            [Import]IEventAggregator eventAggregator,
            [Import]IDialogService dialogs,
            [Import]IAuthorizationService authorizator,
            [Import]IBacklogService backlogService,
            [Import]IProposalsService proposalsService)
        {
            this.executor = executor;
                this.dialogs = dialogs;
                this.aggregator = eventAggregator;

                this.authorizator = authorizator;
                this.proposalsService = proposalsService;
                this.backlogService = backlogService;

                this.aggregator.Subscribe<Project>(ScrumFactoryEvent.ViewProjectDetails, OnViewProjectDetails);

                this.aggregator.Subscribe(ScrumFactoryEvent.RoleHourCostsChanged, LoadProposals);
                this.aggregator.Subscribe<MemberProfile>(ScrumFactoryEvent.SignedMemberChanged, OnSignedMemberChanged);

                this.aggregator.Subscribe(ScrumFactoryEvent.ApplicationWhentBackground, () => { ShowValues = false; });

                OnLoadCommand = new DelegateCommand(CanSeeProposals, () => {
                    ShowValues = false;
                    if (NeedRefresh) LoadProposals();
                });
                AddProposalCommand = new DelegateCommand(CanSeeProposals, AddProposal);
                ShowDetailCommand = new DelegateCommand<Proposal>(CanSeeProposals, ShowDetail);
                ShowHourCostsCommand = new DelegateCommand(CanSeeProposals, ShowHourCosts);
        }
        public HourCostsViewModel(
            [Import] IEventAggregator aggregator,
            [Import] IBackgroundExecutor executor,
            [Import] IAuthorizationService authorizator,
            [Import] IDialogService dialogService,
            [Import] IProposalsService proposalsService)
        {
            this.aggregator = aggregator;
            this.executor = executor;
            this.authorizator = authorizator;
            this.dialogs = dialogService;

            this.proposalsService = proposalsService;
            this.ChangeCostsCommand = new DelegateCommand(ChangeCosts);
            this.CancelCommand = new DelegateCommand(Cancel);
        }
        public ProposalViewModel(
            [Import]IBackgroundExecutor executor,
            [Import]IEventAggregator aggregator,
            [Import]IDialogService dialogs,
            [Import]IProposalsService proposalsService,
            [Import]IProjectsService projectsService)
        {
            this.executor = executor;
                this.aggregator = aggregator;
                this.dialogs = dialogs;
                this.proposalsService = proposalsService;
            this.projectsService = projectsService;

                aggregator.Subscribe<Project>(ScrumFactoryEvent.ViewProjectDetails, OnViewProjectDetails);

                itemsViewSource = new System.Windows.Data.CollectionViewSource();
                itemsViewSource.SortDescriptions.Add(new SortDescription("ItemGroup.DefaultGroup", ListSortDirection.Ascending));
                itemsViewSource.SortDescriptions.Add(new SortDescription("ItemGroup.GroupName", ListSortDirection.Ascending));
                itemsViewSource.SortDescriptions.Add(new SortDescription("Item.Name", ListSortDirection.Ascending));

                CloseWindowCommand = new DelegateCommand(CloseWindow);
                RefreshProposalPriceCommand = new DelegateCommand(CanEdit, RefreshProposalPrice);

                AddClauseCommand = new DelegateCommand(CanEdit, AddClause);
                DeleteClauseCommand = new DelegateCommand<ProposalClause>(CanEdit, DeleteClause);
                MoveClauseDownCommand = new DelegateCommand<ProposalClause>(CanEdit, MoveClauseDown);
                MoveClauseUpCommand = new DelegateCommand<ProposalClause>(CanEdit, MoveClauseUp);

                AddCostCommand = new DelegateCommand(CanEdit, AddFixedCost);
                DeleteCostCommand = new DelegateCommand<ProposalFixedCost>(CanEdit, DeleteCost);

                ApproveCommand = new DelegateCommand(CanEdit, Approve);
                RejectCommand = new DelegateCommand<short>(CanEdit, Reject);

                ShowProposalReportCommand = new DelegateCommand(ShowProposalReport);

                SyncProposalDatesCommand = new DelegateCommand(SyncProposalDates);
        }
        public ProjectSummaryViewModel(
            [Import] IEventAggregator aggregator,
            [Import] IBackgroundExecutor executor,
            [Import] IProjectsService projectsService,
            [Import] IProposalsService proposalsService,
            [Import] ITasksService tasksService,
            [Import] IBacklogService backlogService,
            [Import] IDialogService dialogService,
            [Import] IAuthorizationService autorizatorService)
        {
            this.aggregator = aggregator;
                this.executor = executor;
                this.projectsService = projectsService;
                this.proposalsService = proposalsService;
                this.tasksService = tasksService;
                this.backlogService = backlogService;
                this.dialogService = dialogService;
                this.autorizator = autorizatorService;

                aggregator.Subscribe<Project>(ScrumFactoryEvent.ViewProjectDetails, OnViewProjectDetails, 100);
                aggregator.Subscribe<Project>(ScrumFactoryEvent.ProjectCreated, OnProjectCreation);
                aggregator.Subscribe<MemberProfile>(ScrumFactoryEvent.SignedMemberChanged, OnSignedMemberChanged);

                aggregator.Subscribe<string>(ScrumFactoryEvent.ShowCodeRepositoryLog, ShowProjectRepositoryLog);
                aggregator.Subscribe<string>(ScrumFactoryEvent.ShowCodeRepository, p => {
                    if (String.IsNullOrEmpty(p))
                        p = Project.CodeRepositoryPath;
                    OpenPath(p);
                });

                aggregator.Subscribe<string>(ScrumFactoryEvent.ShowDocRepository, p => {
                    if (String.IsNullOrEmpty(p))
                        p = Project.DocRepositoryPath;
                    OpenPath(p);
                });

                aggregator.Subscribe<ICollection<MemberProfile>>(ScrumFactoryEvent.ProjectMembersChanged, m => {
                    OnMembersLoaded(m);
                    ((DelegateCommand)SendMailCommand).NotifyCanExecuteChanged();
                });

                StartProjectCommand = new DelegateCommand(CanStartProject, StartProject);
                CloseProjectCommand = new DelegateCommand(CanCloseProject, CloseProject);
                EditProjectCommand = new DelegateCommand(CanEditProject, EditProject);

                ShowRepositoryCommand = new DelegateCommand<string>(OpenPath);

                ShowReportCommand = new DelegateCommand<string>(ShowReport);

                ShowProjectTeamCommand = new DelegateCommand(()=> { this.aggregator.Publish(ScrumFactoryEvent.ShowProjectTeam); });

                ChangeUserEngageCommand = new DelegateCommand<ProjectMembership>(ChangeUserEngage);

                RemoveUserEngageCommand = new DelegateCommand<ProjectMembership>(RemoveUserEngage);

                SendMailCommand = new DelegateCommand(CanSendMail, SendMail);

                JoinProjectCommand = new DelegateCommand(ShowJoinDialog);

                CreateCodeRepCommand = new DelegateCommand<ICodeRepositoryService>(CreateCodeRep);
        }