Пример #1
0
        public ShellViewModel(            
            [Import] IBackgroundExecutor backgroundExecutor,
            [Import] IEventAggregator eventAggregator,
            [Import] IDialogService dialogs,
            [Import] Services.IAuthorizationService authorizator)
        {
            AlertMessageViewModel = new MessageBoxViewModel();

                this.executor = backgroundExecutor;
                this.aggregator = eventAggregator;
                this.dialogs = dialogs;
                this.authorizator = authorizator;

                signinMenuText = Properties.Resources.Sign_in;

                aggregator.Subscribe(ScrumFactoryEvent.ShowFullScreen, () => { IsOnTaskMode = false; });
                aggregator.Subscribe<Task>(ScrumFactoryEvent.ShowTaskDetail, t => { IsOnTaskMode = false; }, 10);

                //aggregator.Subscribe(ScrumFactoryEvent.ApplicationWhentForeground, () => { IsOnTaskMode = true; });

                aggregator.Subscribe<MemberProfile>(ScrumFactoryEvent.SignedMemberChanged, OnMemberSignin);

                aggregator.Subscribe<Project>(ScrumFactoryEvent.ProjectDetailsChanged, p => { SelectedProject = p; });

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

                aggregator.Subscribe<bool>(ScrumFactoryEvent.Signing,
                    signing => {
                        if (signing) {
                            IsSigning = true;
                            SigninMenuText = Properties.Resources.Sigining;
                        }
                        else {
                            IsSigning = false;
                            SigninMenuText = Properties.Resources.Sign_in;
                        }
                    });

                SignInCommand = new DelegateCommand(() => {
                    //CloseAllChildWindows();
                    eventAggregator.Publish(ScrumFactoryEvent.ShowLogin);
                });

                MoveWindowCommand = new DelegateCommand(() => { View.DragMove(); });
                CloseWindowCommand = new DelegateCommand(Close);
                MinimizeWindowCommand = new DelegateCommand(Minimize);

                ShowMyProfileCommand = new DelegateCommand(ShowMyProfile);

                ShowAboutDialogCommand = new DelegateCommand(ShowAboutDialog);

                ShowWhatIsNewCommand = new DelegateCommand(ShowWhatIsNewDialog);

                ShowOwnersListCommand = new DelegateCommand(CanShowOwnersList, ShowOwnersList);

                RefreshCommand = new DelegateCommand(Refresh);

                ShowHideTopMenuCommand = new DelegateCommand(ShowHideTopMenu);

                ShowMyTasksCommand = new DelegateCommand(ShowMyTasks);

                ShowOptionsCommand = new DelegateCommand(ShowOptions);

                ShowFactorySettingsCommand = new DelegateCommand(CanShowOwnersList, ShowFactorySettings);
        }
Пример #2
0
 public IDialogViewModel NewDialog(string title, ScrumFactory.Composition.View.IView contentView)
 {
     MessageBoxViewModel vm = new MessageBoxViewModel(title, new MessageBox(), contentView);
     return vm;
 }
Пример #3
0
 /// <summary>
 /// Creates and shows a message box dialog.
 /// </summary>
 /// <param name="title">The title.</param>
 /// <param name="message">The message.</param>
 /// <returns>The user choice.</returns>
 public void ShowMessageBox(string title, string message)
 {
     MessageBoxViewModel vm = new MessageBoxViewModel(title, message, System.Windows.MessageBoxButton.OK, null, new MessageBox());
     vm.Show();
 }
Пример #4
0
 public System.Windows.MessageBoxResult ShowMessageBox(string title, string message, System.Windows.MessageBoxButton buttons, string imageSource)
 {
     MessageBoxViewModel vm = new MessageBoxViewModel(title, message, buttons, imageSource, new MessageBox());
     vm.Show();
     return vm.Result;
 }