I'm learning MVVM pattern and i started this repo as exercising while coding along with SingeleToneSean's Playlist about MVVM I donw own the idea of the apps i summerise the key features here to help myself learn more and my use this reop as example of abstract ideas and design patterns examples reasource.
The app should simply allow a costumer to reserve a room in fictional hotel inserting 5 inputs
- UserName
- FloorNum
- RoomNum
- Date of start
- Date of end
It should show list of all the reservation validate new ones and update SQL local Server .
All this properties are binded to the MakeReservationViewModel properties :
MVVM-Hotel-Reservation-WPF/View/Views/MakeReservationView.xaml
Lines 52 to 55 in 3efa25d
Using Commands I enable and disable the button of submiting checking if there is username , room number and floor number if so calls the OnCanExecute() that invokes the boolian method :
When CanExecute is true the submit button beacome enabled and clicking it calls async method that uses a validator objects to check if there is error in the data / conflict with reservation from the data base
The validator named DatabaseReservationConflictValidator and implementing IReservationConflicValidator so the app is open for new Validetors addition in the future