public void AddDebtorCommandExecute() { //var newDebitor = new Debitors("Insert name"); //Is AddView, naming error _iDialogService.ShowDialog("AddView", null, r => { if (r.Result == ButtonResult.OK) { DebitorsCreditors.Add(((App)Application.Current).Debitor); } }); }
private void OpenFileCommandExecuteTxt() { OpenFileDialog fs = new OpenFileDialog(); // { Filter = "Json (.json)|.json" }; fs.ShowDialog(); filename = fs.FileName; if (filename != "") { string jsonString = File.ReadAllText(filename); DebitorsCreditors.Clear(); DebitorsCreditors = JsonSerializer.Deserialize <ObservableCollection <Debitors> >(jsonString); if (DebitorsCreditors != null) { foreach (var debitor in DebitorsCreditors) { debitor.Debts.RemoveAt(debitor.Debts.Count - 1); } } } }
private void RemoveDebitorCommand() { DebitorsCreditors.RemoveAt(CurrentIndex); }