introduzione a mvvm con mvvm light
DESCRIPTION
Introduzione a MVVM con il toolkit MVVM LightTRANSCRIPT
![Page 1: Introduzione a MVVM con MVVM light](https://reader038.vdocuments.pub/reader038/viewer/2022100507/5598f44b1a28ab5e5e8b47ba/html5/thumbnails/1.jpg)
Introduzione a MVVM con
MVVM Light
Mobile Software Engineer @ Gaia
Microsoft MVP – Device Application Development
Twitter: @qmatteoq
Facebook: http://www.facebook.com/matteo.pagani
Blog: http://qmatteoq.tostring.it
E-mail: [email protected]
Matteo Pagani
![Page 2: Introduzione a MVVM con MVVM light](https://reader038.vdocuments.pub/reader038/viewer/2022100507/5598f44b1a28ab5e5e8b47ba/html5/thumbnails/2.jpg)
ALCUNI CONCETTI
CHIAVE
![Page 3: Introduzione a MVVM con MVVM light](https://reader038.vdocuments.pub/reader038/viewer/2022100507/5598f44b1a28ab5e5e8b47ba/html5/thumbnails/3.jpg)
Binding
Collegamento tra i controlli della UI ed altri
controlli o proprietà
Viene creato un flusso continuo tra UI e
dati
Le due componenti collegate sono
aggiornate ad ogni cambiamento reciproco
![Page 4: Introduzione a MVVM con MVVM light](https://reader038.vdocuments.pub/reader038/viewer/2022100507/5598f44b1a28ab5e5e8b47ba/html5/thumbnails/4.jpg)
Data Context
Ogni controllo può avere un «contesto»
I controlli possono accedere alle proprietà
e ai comandi esposti dal contesto tramite
binding
Il DataContext ha una struttura gerarchica
ad albero
![Page 5: Introduzione a MVVM con MVVM light](https://reader038.vdocuments.pub/reader038/viewer/2022100507/5598f44b1a28ab5e5e8b47ba/html5/thumbnails/5.jpg)
INotifyPropertyChanged
E’ un’interfaccia che possiamo
implementare nelle nostre classi
Ci permette di notificare alla UI ogni
cambiamento tramite il binding
Un utilizzo corretto di questa interfaccia è
indispensabile per implementare
correttamente il pattern MVVM
![Page 6: Introduzione a MVVM con MVVM light](https://reader038.vdocuments.pub/reader038/viewer/2022100507/5598f44b1a28ab5e5e8b47ba/html5/thumbnails/6.jpg)
MVVM LIGHT
![Page 7: Introduzione a MVVM con MVVM light](https://reader038.vdocuments.pub/reader038/viewer/2022100507/5598f44b1a28ab5e5e8b47ba/html5/thumbnails/7.jpg)
MVVM Light
Toolkit realizzato da Laurent Bugnion
Offre classi e interfacce che semplificano
l’implementazione del pattern
Integra un Message Broker, che ci
permette di mandare messaggi da una
classe all’altra per spedire informazioni e
gestire eventi
![Page 8: Introduzione a MVVM con MVVM light](https://reader038.vdocuments.pub/reader038/viewer/2022100507/5598f44b1a28ab5e5e8b47ba/html5/thumbnails/8.jpg)
LET’S CODE!