Skip to content

EgonRasmussen/MVVMdemo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

1.BasicViewModel

Her ses MVVM folder- og filorganisering:

I ViewModels folderen oprettes en ViewModel klasse pr. Page. Constructoren indlæser data i properties, som View'et kan binde til. Der laves Change-notification til relevante properties.

I Views folderen placeres alle Pages. Code-behind indeholder kun en oprettelse af ViewModel objektet:

using MVVM.ViewModels;
using Xamarin.Forms;

namespace MVVM
{
    public partial class MainPage : ContentPage
    {
        public MainPage()
        {
            InitializeComponent();
            BindingContext = new MainPageViewModel();
        }
    }
}

About

Demo af MVVM i Xamarin Forms (App Prog III)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages