-
Notifications
You must be signed in to change notification settings - Fork 1
Architecture
This document serve to explain some stuff
The IoC container used in this project is AutoFac, selected due to ease of use, as well as good documentation and multiple examples of people using it on their Xamarin project.
To use an IoC container:
- Register types
- Specify lifetime
- Resolve
The ViewModelLocator is to allow design time evaluation of the ViewModel while still allowing constructor injection of the ViewModel.
The ViewModelLocator will and should be called whenever a Page is created. This is done through binding the BindingContext of the Page to the appropriate ViewModel exposed by the ViewModelLocator. This will result in the creation of the appropriate ViewModel along with the Page.
The constructor injection is done through the use of the IoC Container.
The logging is done through the use of log4net, which is a highly popular library in .NET for logging.
Main advantages:
- Can specify logging levels
- Easily include timestamp of log
- Easily format log string
- Easily change logging medium, i.e. Console, Text file, etc.
- Simple to use