Skip to content

This repository contains sample about working with ListView in MVVMCross

Notifications You must be signed in to change notification settings

SyncfusionExamples/listview_MVVMCross

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

Working with ListView in MVVMCross

Requirements

MVVMCross version - 6.3.1

ListView with MVVMCross

The SfListView allows users work with MVVMCross Framework. Follow the below steps to work withMVVMCross Framework:

  1. Inherit App.cs from MvxApplication instead of your application.
  2. Inherit ViewModel from the MvxViewModel.
  3. Connect view and view model instead of binding context by registering them.
  4. Derive MainActivity and AppDelegate from MvxFormsAppCompatActivity and MvxFormsApplicationDelegate for initializing renderer.
public class CoreApp : MvvmCross.Core.ViewModels.MvxApplication
{
    public override void Initialize()
    {
        CreatableTypes()
            .EndingWith("Service")
            .AsInterfaces()
            .RegisterAsLazySingleton();

        RegisterNavigationServiceAppStart<ViewModels.MvxFormsViewModel>();
    }
}
public class MvxFormsViewModel : MvxViewModel
{
    public MvxFormsViewModel()
    {

    }
}
public class MainActivity : MvxFormsAppCompatActivity
{
    protected override void OnCreate(Bundle bundle)
    {
        base.OnCreate(bundle);
        TabLayoutResource = Resource.Layout.Tabbar;
        ToolbarResource = Resource.Layout.Toolbar;
    }
}


public partial class AppDelegate : MvxFormsApplicationDelegate
{
    public override UIWindow Window { get; set; }

    public override bool FinishedLaunching(UIApplication app, NSDictionary options)
    {
        SfListViewRenderer.Init();
    }
}

For more details, refer to this documentation.

About

This repository contains sample about working with ListView in MVVMCross

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •  

Languages