public TransactionsPage() { this.transactionMapper = new TransactionMapper(); this.transactionIOService = new TransactionIO(); this.InitializeComponent(); this.viewModel = new TransactionsPageViewModel(); this.DataContext = this.viewModel; }
private void InitializeViewModel() { _viewModel = new TransactionsPageViewModel() { // transactions AddRecordCommand = new Command(() => OpenDetails(_recordService.PrepareNew(new RecordModel() { UserId = GlobalVariables.UserId }), true)), AddMoneyTransferCommand = new Command(() => OpenDetails(new MoneyTransferModel(), true)), AddChequeCommand = new Command(() => { var chequeWindow = new ChequeWindow(); chequeWindow.Owner = Window.GetWindow(this); if (chequeWindow.ShowDialog() == true) { Reload(); } }), EditTransactionCommand = InitTransactionEditCommand(), DeleteTransactionCommand = InitTransactionDeleteCommand(), ApplyNowPlannedTransactionCommand = InitTransactionApplyNowCommand(), CreateTransactionFromPlannedCommand = InitTransactionCreateTransactionCommand(), DuplicateAndApplyNowTransactionCommand = InitDuplicateAndApplyNowCommand(), DuplicateTransactionCommand = InitDuplicateTransactionCommand(), CreateTemplateFromTransactionCommand = InitCreateTemplateFromTransactionCommand(), // templates AddRecordTemplateCommand = new Command(() => OpenDetails(_recordTemplateService.PrepareNew(new RecordTemplateModel() { UserId = GlobalVariables.UserId }), true)), AddMoneyTransferTemplateCommand = new Command(() => OpenDetails(new MoneyTransferTemplateModel(), true)), EditTemplateCommand = InitTemplateEditCommand(), DeleteTemplateCommand = InitTemplateDeleteCommand(), ApplyNowTemplateCommand = InitTemplateApplyNowCommand(), CreateTransactionFromTemplateCommand = InitTemplateCreateTransactionCommand() }; this.DataContext = _viewModel; }
public TransactionsPage() { InitializeComponent(); BindingContext = viewModel = new TransactionsPageViewModel(); }