DLToolkit.PageFactory for Xamarin.Forms
The main reason for creation of PageFactory was that I needed very simple to use library which would free me from implementing the same things for any Xamarin.Forms project I created all over again. Those things were eg. Page Caching, ViewModel oriented Navigation, INotifyPropertyChanged implementation, ViewModel and Page/ViewModel messaging, etc. I also wanted my ViewModels to be as clean as possible (dependency free).
There's no additional configuration needed. All you need is:
- ViewModels implementing
INotifyPropertyChanged
interface (orIBaseMessagable
interface if you want receive messages also in ViewModel) or usingBaseViewModel
(ready to go implementation of it) - Define your pages as PF[PageType] (eg.
PFContentPage<YourViewModelType>
insteadContentPage
OR inherit from them if you make a custom pages types) OR ImplementIBasePage<INotifyPropertyChanged>
interface (undocumented) for your custom pages types. - Set your MainPage as navigation page returned from
XamarinFormsPageFactory.Init()
method
Project site:
https://github.com/daniel-luberda/DLToolkit.PageFactory/ (You can find some examples there)
NuGet:
https://www.nuget.org/packages/DLToolkit.PageFactory.Forms/ (PCL compatibile)
https://www.nuget.org/packages/DLToolkit.PageFactory.Shared/ (PCL compatibile)
If you're interested - Feel free to test it (it's in early stage). Just mind it's in alpha.