|
|
@@ -1,8 +1,9 @@
|
|
|
-using Awsomeness.Core;
|
|
|
+using Awesomeness.Core;
|
|
|
using CommunityToolkit.Mvvm.ComponentModel;
|
|
|
using CommunityToolkit.Mvvm.Input;
|
|
|
using System;
|
|
|
using System.Collections.Generic;
|
|
|
+using System.Collections.ObjectModel;
|
|
|
using System.Linq;
|
|
|
using System.Text;
|
|
|
using System.Threading.Tasks;
|
|
|
@@ -11,10 +12,18 @@ namespace Awesomeness.GUI.ViewModels;
|
|
|
|
|
|
partial class MainViewModel : ObservableObject
|
|
|
{
|
|
|
- private Person _person;
|
|
|
+ private Person scratchPerson;
|
|
|
+ private Person selectedPerson;
|
|
|
+ private CatalogOfPeople catalog;
|
|
|
+ public ObservableCollection<string> AvailableNames;
|
|
|
public MainViewModel()
|
|
|
{
|
|
|
- _person = new Person();
|
|
|
+ scratchPerson = new Person();
|
|
|
+ catalog = new CatalogOfPeople();
|
|
|
+ AvailableNames = new ObservableCollection<string>();
|
|
|
+
|
|
|
+ AvailableNames.Add("Bullshit");
|
|
|
+ AvailableNames.Add("Another Crap");
|
|
|
}
|
|
|
|
|
|
[ObservableProperty]
|
|
|
@@ -35,12 +44,17 @@ partial class MainViewModel : ObservableObject
|
|
|
[RelayCommand]
|
|
|
private void SetName()
|
|
|
{
|
|
|
- _person.FirstName = FirstName;
|
|
|
+ scratchPerson.FirstName = FirstName;
|
|
|
}
|
|
|
|
|
|
[RelayCommand]
|
|
|
private void GetName()
|
|
|
{
|
|
|
- FirstName = _person.FirstName;
|
|
|
+ FirstName = scratchPerson.FirstName;
|
|
|
+ }
|
|
|
+ [RelayCommand]
|
|
|
+ private void AddNameToCatalog()
|
|
|
+ {
|
|
|
+ AvailableNames.Add("Kastöga");
|
|
|
}
|
|
|
}
|