コード例 #1
0
        public TransferEditorViewModel(
                ITransferRepository transferRepository,
                IBankAccountRepository bankAccountRepository,
                IBankAccountAgent bankAccountAgent,
                IEnumerable<IScheduleFrequency> frequencyCalculators,
                Transfer entity
            )
        {
            this.transferRepository = transferRepository;
            this.bankAccountRepository = bankAccountRepository;
            this.bankAccountAgent = bankAccountAgent;
            this.frequencyCalculators = frequencyCalculators;
            this.entity = entity;

            this.Amount.PropertyChanged += (s,e) =>
                {
                    base.Validate();
                };
            base.ValidationHelper.AddInstance(this.Amount);

            this.FrequencyEvery.PropertyChanged += (s, e) =>
            {
                base.Validate();
                NotifyPropertyChanged(() => this.FrequencyEveryLabel);
            };
            base.ValidationHelper.AddInstance(this.FrequencyEvery);

            NewFromBankAccountCommand = base.AddNewCommand(new ActionCommand(this.NewFromBankAccount));
            NewToBankAccountCommand = base.AddNewCommand(new ActionCommand(this.NewToBankAccount));
        }
コード例 #2
0
        public TransferEditorViewModel(
            ITransferRepository transferRepository,
            IBankAccountRepository bankAccountRepository,
            IBankAccountAgent bankAccountAgent,
            IEnumerable <IScheduleFrequency> frequencyCalculators,
            Transfer entity
            )
        {
            this.transferRepository    = transferRepository;
            this.bankAccountRepository = bankAccountRepository;
            this.bankAccountAgent      = bankAccountAgent;
            this.frequencyCalculators  = frequencyCalculators;
            this.entity = entity;

            this.Amount.PropertyChanged += (s, e) =>
            {
                base.Validate();
            };
            base.ValidationHelper.AddInstance(this.Amount);

            this.FrequencyEvery.PropertyChanged += (s, e) =>
            {
                base.Validate();
                NotifyPropertyChanged(() => this.FrequencyEveryLabel);
            };
            base.ValidationHelper.AddInstance(this.FrequencyEvery);

            NewFromBankAccountCommand = base.AddNewCommand(new ActionCommand(this.NewFromBankAccount));
            NewToBankAccountCommand   = base.AddNewCommand(new ActionCommand(this.NewToBankAccount));
        }
コード例 #3
0
        public BankAccountListViewModel(
            IBankAccountRepository bankAccountRepository,
            IBankAccountAgent bankAccountAgent
            )
        {
            this.bankAccountRepository = bankAccountRepository;
            this.bankAccountAgent      = bankAccountAgent;

            ReloadCommand = base.AddNewCommand(new ActionCommand(Reload));
            AddCommand    = base.AddNewCommand(new ActionCommand(Add));
            EditCommand   = base.AddNewCommand(new ActionCommand(Edit, CanEdit));
            DeleteCommand = base.AddNewCommand(new ActionCommand(Delete, CanDelete));
        }