Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/bulubuloa/SupportXFLite
A simple MVVM Framework for Xamarin Forms, it helps you to quick setup a new Xamarin Forms project. I used this library in my personal project and my company also every day :)
https://github.com/bulubuloa/SupportXFLite
Last synced: 30 days ago
JSON representation
A simple MVVM Framework for Xamarin Forms, it helps you to quick setup a new Xamarin Forms project. I used this library in my personal project and my company also every day :)
- Host: GitHub
- URL: https://github.com/bulubuloa/SupportXFLite
- Owner: bulubuloa
- Created: 2018-11-18T04:06:55.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-01-02T08:55:47.000Z (almost 6 years ago)
- Last Synced: 2024-10-10T15:37:13.020Z (2 months ago)
- Language: C#
- Homepage: https://www.nuget.org/packages/SupportXFLite/
- Size: 3.86 MB
- Stars: 15
- Watchers: 2
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Support: SupportXFLite.Droid/DependencyExtended/IFileHelperExtended.cs
Awesome Lists containing this project
- awesome-xamarin-forms - SupportXFLite ★9
README
# SupportXFLite
A simple MVVM Framework for Xamarin Forms. It helps you to quicksetup a new Xamarin.Forms project and save a lot of your time with a few steps.. I used this library in my personal project and my company also every day :)
#### Available on NuGet
![Build status](https://ci.appveyor.com/api/projects/status/7g3sppml9ewumr9i/branch/master?svg=true) [![NuGet Badge](https://buildstats.info/nuget/SupportXFLite)](https://www.nuget.org/packages/SupportXFLite/)## GETTING STARTED
### 1. Create class manager you project, it based on **SupportProjectXF** class
```
public class InitializeProject : SupportProjectXF
{
private async Task InitilizeNavigationPageWithPage(Xamarin.Forms.Page page)
{
var navigationPageWidget = new SupportNavigationPageWidget()
{
BarTextColor = Color.White,
BarBackgroundColor = Color.FromHex("#005e93")
};
if (page != null)
await navigationPageWidget.PushAsync(page);
return navigationPageWidget;
}/*
* Custom your app flow view
*/
public async override Task SetupNavigationMap(Page page, Type viewModelType, object parameter, bool animate)
{
if (page is AES_LoginView)
{
if (CurrentApplication.MainPage is SupportNavigationPageWidget)
{
var currentNavigation = CurrentApplication.MainPage as SupportNavigationPageWidget;
await currentNavigation.PopToRootAsync(true);
}
else
{
CurrentApplication.MainPage = await InitilizeNavigationPageWithPage(page);
}
}
else if (CurrentApplication.MainPage is SupportNavigationPageWidget)
{
var currentNavigationX = (SupportNavigationPageWidget)CurrentApplication.MainPage;
var currentPage = currentNavigationX.CurrentPage;if (page.GetType() != currentNavigationX.CurrentPage.GetType())
await currentNavigationX.PushAsync(page, true);
}
else
{
CurrentApplication.MainPage = await InitilizeNavigationPageWithPage(page);
}
}
/*
* Register your controller, based on dependency injection
*/
protected override void RegisterController(BaseLocator locator)
{
locator.Register();
}
/*
* Register your viewmodel or any class, based on dependency injection
*/
protected override void RegisterViewModel(BaseLocator locator)
{
locator.Register();
locator.Register();
}
/*
* map your view page with viewmodel
*/
protected override void MappingViewAndViewModel(BaseNavigationService navigationManager)
{
navigationManager.Map();
navigationManager.Map();
}
}
```### 2. Create new object of Manager
- Open App.xaml.cs and add it to content
```
public static InitializeProject Manager;
static App()
{
Manager = new InitializeProject();
}
```
- In the contructor of App
```
public App()
{
InitializeComponent();
//Open first screen
var navigationService = Manager.NavigationManager;
navigationService.NavigateToAsync(true);
}
```### 3. Setup for each platforms
Setup for iOS project (add to AppDelegate before LoadApplication)SupportXFLiteSetup.Initialize(this);
Setup for Android project (add to MainActivity before LoadApplication)
SupportXFLiteSetup.Initialize(this, savedInstanceState);
### DEMO APP
https://github.com/bulubuloa/DefaultAPP_Lite