Example #1
0
        /// <summary>
        ///  Initializes boards and tasks.
        ///  Sorts the tasks by column index so that they are
        ///  loaded in as they were left when the app was last closed.
        /// </summary>
        public MainViewModel(
            Func <PresentationBoard, IAppNotificationService, BoardViewModel> boardViewModelFactory,
            IAdaptiveClient <IServiceManifest> dataProvider,
            INavigationService navigationService,
            IAppNotificationService appNotificationService,
            IDialogService dialogService)
        {
            this.boardViewModelFactory   = boardViewModelFactory;
            this.dataProvider            = dataProvider;
            this._navigationService      = navigationService;
            this._appNotificationService = appNotificationService;
            this._dialogService          = dialogService;

            PropertyChanged       += MainViewModel_PropertyChanged;
            NewBoardCommand        = new Base.RelayCommand(NewBoard, () => true);
            EditBoardCommand       = new Base.RelayCommand(EditBoard, () => CurrentBoard != null);
            SaveBoardCommand       = new Base.RelayCommand(SaveBoard, () => true);
            CancelSaveBoardCommand = new Base.RelayCommand(CancelSaveBoard, () => true);
            DeleteBoardCommand     = new Base.RelayCommand(DeleteBoard, () => CurrentBoard != null);
            OpenSettingsCommand    = new AsyncRelayCommand(OpenSettingsDialog, () => true);
            OpenCalendarCommand    = new AsyncRelayCommand(OpenCalendarDialog, () => true);
            OpenBoardListCommand   = new AsyncRelayCommand(OpenBoardListDialog, () => true);

            InitializeBoards();
        }
        /// <summary>
        /// Class constructor
        /// </summary>
        /// <param name="docManager"></param>
        /// <param name="leftDirPath"></param>
        /// <param name="rightDirPath"></param>
        public DirDiffDocViewModel(IDocumentManagerViewModel docManager,
                                   string leftDirPath,
                                   string rightDirPath)
            : this()
        {
            _DocumentManager = docManager;

            Title     = "Compare Directories";
            ContentId = SetupContentID;

            _CurrentStage = DirDiffDocStages.DirDiffSetup;

            var createViewPageCommand = new Base.RelayCommand <object>(
                (p) => CreatePageViewCommand_Executed(p),
                (p) => CreatePageViewCommand_CanExecute(p));

            _SelectedDirDiffItem = new DirDiffDocSetupViewModel(createViewPageCommand, leftDirPath, rightDirPath);
        }
 private void NavigationCommands()
 {
     ToLogin = new Base.RelayCommand(NavigateToLogin);
 }
 private void CreateCommands()
 {
     Login = new Base.RelayCommand(OnLogin, () => !(string.IsNullOrEmpty(UserName) || string.IsNullOrEmpty(Password)));
     Logout = new Base.RelayCommand(OnLogout);
     Send = new Base.RelayCommand(OnSend);
     ClearCommand = new Base.RelayCommand(OnClear);
 }