Would This be correct my Teacher said we could only use her solution but here is mine

1 week ago 9
ARTICLE AD BOX
namespace ViewModel { public class VMMannschaft : INotifyPropertyChanged { private Mannschaft mannschaft; public VMMannschaft(string nation) { mannschaft = new Mannschaft(nation); } public string Nation { get =\\\> mannschaft.Nation; } public int Spiele { get =\\\> mannschaft.Spiele; } public int Punkte { get =\\\> mannschaft.Punkte; } public void Sieg() { mannschaft.Sieg(); OnPropertyChanged("Punkte"); OnPropertyChanged("Spiele"); } public void Niederlage() { mannschaft.Niederlage(); OnPropertyChanged("Punkte"); OnPropertyChanged("Spiele"); } public void Unentschieden() { mannschaft.Unentschieden(); OnPropertyChanged("Punkte"); OnPropertyChanged("Spiele"); } public Mannschaft Mannschaft { get =\\\> mannschaft; private set =\\\> mannschaft = value; } public event PropertyChangedEventHandler? PropertyChanged; public void OnPropertyChanged(string propertyName) { PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName)); } public override string ToString() { return Nation; } }

So we have c# class and i have my INotifyPropertyChanged in a different order then she does and slightly altered but i wanted to make sure that this is also ok.

Read Entire Article