Understanding the MVVM pattern

Slides:



Advertisements
Similar presentations
Module 1: Creating an Application by Using Windows Presentation Foundation Overview of WPF Creating a Simple WPF Application Handling Events and Commands.
Advertisements

Migration of a VFP application into a Silverswitch solution
.NET 3.5 SP1 New features Enhancements Visual Studio 2008 SP1 New features Enhancements Additional features/enhancements.
Introduction to ASP.NET MVC
Expression Blend 4 – deep dive
Silverlight is dead! Long live MVVM!
MVVM Basics with Caliburn.Micro Presented by Stefan Nuxoll, Lithium PC.
July 2010 D2.1 Upgrading strategy Javier Soto Catalog Release 3. Communities.
02 | New Features for Web Developers Susan Ibach| Technical Evangelist Christopher Harrison | Head Geek.
Silverlight Presenter: Kevin Grossnicklaus February 25 th, 2010.
Developing HTML5 Application using MVVM pattern Pekka Ylenius.
DEEP DIVE MVVM Laurent Bugnion Director, UX Integration IdentityMine
USING THE MODEL-VIEW- VIEWMODEL PATTERN Laurent Bugnion Director, User Experience Integration IdentityMine
Lessons learned from developing a Windows 8 Metro application in C# Frode Nilsen Nilsen Labs Ticki.
Practical MVVM Joel Cochran.
An Introduction to the Model-View-ViewModel Pattern Srsly? Another MV* Pattern? Srsly? Another MV* Pattern?
Or How I Learned to Stop Worrying and Love the Binding Bryan Anderson.
An Introduction To Silverlight Gergely Orosz
Laurent Bugnion Senior User Experience Integrator IdentityMine
WPF MVVM Training Michael Sync (Silverlight MVP).
Laurent Bugnion Director, UX MVVM Powers Silverlight Development.
Real world Windows Phone development Igor
Building Silverlight Applications Using the MVVM pattern An Introduction by Peter Messenger Senior Developer – Qmastor
Shailen Sukul Senior Solutions Architect EMC BSc | Mct | Mcpd (.Net 2/3.5) | Mcts (Sharepoint (MOSS/WSS), Biztalk, Web, Win, Dist Apps) | Mcsd.NET | Mcsd.
Joe xamlcoder.com/blog Silverlight / WPF Consultant.

Laurent Bugnion Senior Software Engineer Siemens Building Technologies.
.NET Database Technologies: Introduction to WPF and Entity Framework DataBinding.
Visual Basic Advanced Programming.
Rudi Grobler Session Code: WUX205.
ASP.NET &.NET Environment. Overview Part of Microsoft’s.NET environment Used for Development of  Websites  Internet applications  Web Services & XML.
Windows Phone MVVM and Unit Testing Step by Step Andy Wigley Windows Phone Development MVP, Mobile Software Consultant APPA Mundi Ltd WPH208.
Jaime Rodriguez | Microsoft Principal Technical Evangelist Laurent Bugnion | IdentityMine Senior Director XAML Deep Dive for Windows & Windows Phone Apps.
A day in the life of an Integrator Laurent Bugnion Senior User Experience Integrator IdentityMine
Model View Controller MVC Web Software Architecture.
Nikhil Kothari Software Architect Microsoft Corporation Session Code: WUX312.
WINDOWS PHONE 7.5 “MANGO” ADVANCED Laurent Bugnion Director of UX Integration IdentityMine
Windows 10 UWP MVVM In Depth
Overview of the MVVM pattern for Silverlight and WPF.
Windows Phone 7 Mobile Code Camp The Why Why develop for Windows Phone 7 versus Droid or iPhone? It’s all relative to total app users. SDK and Environment.
04 |Sharing Code Between Windows 8 and Windows Phone 8 in Visual Studio Ben Riga
Model View ViewModel Architecture. MVVM Architecture components.
Integrating and Extending Workflow 8 AA301 Carl Sykes Ed Heaney.
MVVM Pattern Mahender Senior Software Engineer United Health Group.
Windows 8 apps and the MVVM pattern SILVERLIGHTSHOW.NET WEBINARS SERIES GILL CLEEREN, October 16 th
© Copyright SELA software & Education Labs Ltd Baruch Hirsch St.Bnei Brak Israel
Programming with MVVM Miguel A. Castro Architect -
/DEV/TM #1 Building Cross-Platform Apps with Xamarin and MvvmCross Flavius-Radu DEMIAN.
Igor Ralić igrali.com Open source u razvoju Windows Phone aplikacija.
Benjamin Unit Testing & Test-Driven Development for Mere Mortals.
Working in a Mobile App Development Environment Lesson 2.
Jim Fawcett CSE686 – Internet Programming Spring 2014
In Windows 8 Store Applications
Real world Windows Phone development
Introducing the Windows Mobile development
MVVM Made Simple with Prism
Unit testing your metro style apps built using XAML
Ben Riga 02 | Basics of View Models Ben Riga
The Modern ASP.NET Tech Stack!
Build Windows 10 UWP MVVM Apps with Prism
It’s a Knockout! MVVM Style Web Development
Introduction to the MVVM Pattern
תכנות אסינכרוני, תקשורת ופיתוח אפליקציות ל-Windows 8
Microsoft Build /30/2018 2:15 AM Migrating Silverlight Windows Phone apps to the Universal Windows Platform Ricardo Villalobos Principal SDE Manager.
An introduction to MVVM using WPF NISCHAL S
Tech Ed North America /1/2018 4:27 PM Required Slide
MIX 09 12/8/2018 4:33 PM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered.
Working across the .NET Continuum
XAML Deep Dive for Windows & Windows Phone Apps Jump Start
An Introduction to the Model-View-ViewModel Pattern
Presentation transcript:

Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

Model – View – ViewModel « MVVM in a SLOOB with SLUT » What is MVVM? A weird acronym Model – View – ViewModel « MVVM in a SLOOB with SLUT » Woven into WPF/SL Some confusion: MVVM is really just the pattern The rest are helpers, practices, etc

The MVC pattern Model View Controller

The Passive View pattern Model View Controller

The Presentation Model pattern View DataBinding Presentation Model (ViewModel)

Testability, Maintainability, Blendability “The ability to be edited in Blend” (and Visual Studio designer…) Differentiate code in design and runtime Create design time data

Hello MVVM (and Hi Blend) Demo of connection to WCF service, fails in Blend Show how to attach to process Identify problem IsInDesignMode

Bridging the gap View DataBinding Commands Messages ViewModel Model

View ViewModel View ViewModel View ViewModel Bridging the gap View ViewModel View ViewModel Messages View ViewModel Messages + callback

“Point of entry” for a method” Can be data bound ICommand interface Commands “Point of entry” for a method” Can be data bound ICommand interface Execute method CanExecute method CanExecuteChanged event handler

Commands and RelayCommands Demo of connection to WCF service, fails in Blend Show how to attach to process Identify problem IsInDesignMode

RelayCommands RelayCommand MyCommand = new RelayCommand( () => ..., () => true | false); RelayCommand<T> MyGenericCommand = new RelayCommand<T>( p => ..., p => true | false);

Should be simple by default Possible to open filtered channels Messaging Should be simple by default Possible to open filtered channels To a target Type (or an Interface) With a Token With various Messenger instances No constraints at all

Messaging Demo of connection to WCF service, fails in Blend Show how to attach to process Identify problem IsInDesignMode

Messaging Messenger.Default.Register<T>( this, p => DoSomething(p)); Messenger.Default.Send<T>(p);

“Breaking the monotony” http://www.galasoft.ch/mvvm/getstarted MVVM Light Toolkit “Breaking the monotony” http://www.galasoft.ch/mvvm/getstarted http://mvvmlight.codeplex.com V3 released at MIX10 Keep it small Keep it simple

ESSENTIALS RelayCommand Messenger ViewModelBase EXTRAS EventToCommand MVVM Light Libraries V3 ESSENTIALS RelayCommand Messenger ViewModelBase EXTRAS EventToCommand DispatcherHelper

Project templates (VS + Blend) Item templates (VS + Blend) MVVM Light Tools V3 Project templates (VS + Blend) Item templates (VS + Blend) Code snippets

MVVM Light Toolkit, Unity, Blendability Demo of connection to WCF service, fails in Blend Show how to attach to process Identify problem IsInDesignMode

INotifyPropertyChanged Commands Flaws of MVVM Too much code needed INotifyPropertyChanged Commands Some operations are tricky (set focus…) Not applicable to ASP.NET, etc Message to community is not clear

“No code in the code behind” Debunking the myths “No code in the code behind” “If you put code in the View's code-behind, the MVVM police will take your family away” “No need for converters” “MVVM is only suitable for big projects” “MVVM costs performance” “MVVM is complex / makes my head hurt”

“I don’t need separation because I don’t have a designer” Debunking the myths “I don’t need separation because I don’t have a designer” “You cannot use MVVM with other patterns” “MVVM will make you rich and attractive”

MVVM on the Windows Phone 7 Demo of connection to WCF service, fails in Blend Show how to attach to process Identify problem IsInDesignMode

Thanks @LBugnion http://blog.galasoft.ch http://www.galasoft.ch/mvvm/getstarted @LBugnion