public void InitAddTransaction(bool income, string[] categories) { HomeAccountingViewModel vm = DataContext as HomeAccountingViewModel; categoryComboBox.ItemsSource = categories; vm.Category = "Uncategorised"; vm.TransactionDate = DateTime.Today; }
private void AddClick(object sender, RoutedEventArgs e) { HomeAccountingViewModel vm = DataContext as HomeAccountingViewModel; spreadsheetControl1.BeginUpdate(); try { generator.AddTransaction(IsIncome, vm.TransactionDate, (float)Convert.ToDouble(vm.Sum, CultureInfo.CurrentCulture), vm.Category); } finally { spreadsheetControl1.EndUpdate(); } }