Simple application used to manage a list of candidates for studies, The manager class is able to Add, Remove, Get, Update students.
This class Inhertice from IEnumrable
and IRepository<T>
.
- Model (Student / Person, Configuration, StudentsManager...)
Sudents manager class which organizes all the students and is able to Update, Get, Add, Remove any student and a sorting function which sort the whole Students to the UI.
Students-Manager-MVVM-UWP/Dal/StudentContainer.cs
Lines 41 to 76 in 9ca4a21
- View (XAML)
Running application - Manger page contains Search, Add, Sort and etc..
- View-Model (MainView model)
public class MainViewModelBase : INotifyPropertyChanged, INotifyCollectionChanged
{
public event PropertyChangedEventHandler PropertyChanged;
public event NotifyCollectionChangedEventHandler CollectionChanged;
event PropertyChangedEventHandler INotifyPropertyChanged.PropertyChanged
{
add { this.PropertyChanged += value; }
remove { this.PropertyChanged -= value; }
}
protected virtual void RaisePropertyChanged([CallerMemberName] string propertyName = "")
=> PropertyChanged?.Invoke(this, new PropertyChangedEventArgs(propertyName));
public virtual void RaiseCollectionChanged(NotifyCollectionChangedEventArgs e) => this.CollectionChanged?.Invoke(this, e);
public virtual void RaisePropertyChanged(PropertyChangedEventArgs e) => this.PropertyChanged?.Invoke(this, e);
}
A sorting comparer allows the manager to select any kind of sort and display the results. Sorting comparers are delegates which the manager selects and passes it to the
StudentsContainer
class.Students-Manager-MVVM-UWP/Dal/Comparers/CompareGradesHigh.cs
Lines 6 to 10 in 9ca4a21