understanding the mvvm pattern laurent bugnion senior user experience integrator identitymine...

25

Upload: natalie-newsum

Post on 14-Dec-2015

221 views

Category:

Documents


0 download

TRANSCRIPT

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

Understanding the MVVM patternLaurent Bugnion

Senior User Experience Integrator

IdentityMine

http[blog|www]galasoftch

What is MVVM

bull A weird acronymbull Model ndash View ndash ViewModelbull laquo MVVM in a SLOOB with SLUT raquo

bull Woven into WPFSLbull Some confusion

bull MVVM is really just the patternbull The rest are helpers practices etc

The MVC pattern

Model View

Controller

The Passive View pattern

Model View

Controller

The Presentation Model pattern

Model View

Presentation Model

(ViewModel)

DataBinding

Blendability

bull Testability Maintainability Blendability

bull ldquoThe ability to be edited in Blendrdquo

bull (and Visual Studio designerhellip)

bull Differentiate code in design and runtime

bull Create design time data

DEMO

Hello MVVM (and Hi Blend)

Bridging the gap

View

ViewModel

DataBinding Commands Messages

Model

Bridging the gap

View

ViewModelView

ViewModel

View

ViewModelMessages

Messages+ callback

Commands

bull ldquoPoint of entryrdquo for a methodrdquo

bull Can be data bound

bull ICommand interface

bull Execute method

bull CanExecute method

bull CanExecuteChanged event handler

DEMO

Commandsand RelayCommands

RelayCommands

RelayCommand MyCommand = new RelayCommand( () =gt () =gt true | false)

RelayCommandltTgt MyGenericCommand = new RelayCommandltTgt( p =gt p =gt true | false)

Messaging

bull Should be simple by default

bull Possible to open filtered channels

bull To a target Type (or an Interface)

bull With a Token

bull With various Messenger instances

bull No constraints at all

DEMOMessaging

Messaging

MessengerDefaultRegisterltTgt( this p =gt DoSomething(p))

MessengerDefaultSendltTgt(p)

MVVM Light Toolkit

bull ldquoBreaking the monotonyrdquo

bull httpwwwgalasoftchmvvmgetstarted

bull httpmvvmlightcodeplexcom

bull V3 released at MIX10bull Keep it smallbull Keep it simple

MVVM Light Libraries V3

bull ESSENTIALSbull RelayCommandbull Messengerbull ViewModelBase

bull EXTRASbull EventToCommandbull DispatcherHelper

MVVM Light Tools V3

bull Project templates (VS + Blend)

bull Item templates (VS + Blend)

bull Code snippets

DEMO

MVVM Light ToolkitUnityBlendability

Flaws of MVVM

bullToo much code neededbull INotifyPropertyChangedbullCommands

bullSome operations are tricky (set focushellip)

bullNot applicable to ASPNET etcbullMessage to community is not clear

Debunking the myths

bullldquoNo code in the code behindrdquobull ldquoIf you put code in the Views code-behind the MVVM police will take your family awayrdquo

bull ldquoNo need for convertersrdquo

bullldquoMVVM is only suitable for big projectsrdquo

bullldquoMVVM costs performancerdquobullldquoMVVM is complex makes my head hurtrdquo

Debunking the myths

bullldquoI donrsquot need separation because I donrsquot have a designerrdquo

bullldquoYou cannot use MVVM with other patternsrdquo

bullldquoMVVM will make you rich and attractiverdquo

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 2: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

What is MVVM

bull A weird acronymbull Model ndash View ndash ViewModelbull laquo MVVM in a SLOOB with SLUT raquo

bull Woven into WPFSLbull Some confusion

bull MVVM is really just the patternbull The rest are helpers practices etc

The MVC pattern

Model View

Controller

The Passive View pattern

Model View

Controller

The Presentation Model pattern

Model View

Presentation Model

(ViewModel)

DataBinding

Blendability

bull Testability Maintainability Blendability

bull ldquoThe ability to be edited in Blendrdquo

bull (and Visual Studio designerhellip)

bull Differentiate code in design and runtime

bull Create design time data

DEMO

Hello MVVM (and Hi Blend)

Bridging the gap

View

ViewModel

DataBinding Commands Messages

Model

Bridging the gap

View

ViewModelView

ViewModel

View

ViewModelMessages

Messages+ callback

Commands

bull ldquoPoint of entryrdquo for a methodrdquo

bull Can be data bound

bull ICommand interface

bull Execute method

bull CanExecute method

bull CanExecuteChanged event handler

DEMO

Commandsand RelayCommands

RelayCommands

RelayCommand MyCommand = new RelayCommand( () =gt () =gt true | false)

RelayCommandltTgt MyGenericCommand = new RelayCommandltTgt( p =gt p =gt true | false)

Messaging

bull Should be simple by default

bull Possible to open filtered channels

bull To a target Type (or an Interface)

bull With a Token

bull With various Messenger instances

bull No constraints at all

DEMOMessaging

Messaging

MessengerDefaultRegisterltTgt( this p =gt DoSomething(p))

MessengerDefaultSendltTgt(p)

MVVM Light Toolkit

bull ldquoBreaking the monotonyrdquo

bull httpwwwgalasoftchmvvmgetstarted

bull httpmvvmlightcodeplexcom

bull V3 released at MIX10bull Keep it smallbull Keep it simple

MVVM Light Libraries V3

bull ESSENTIALSbull RelayCommandbull Messengerbull ViewModelBase

bull EXTRASbull EventToCommandbull DispatcherHelper

MVVM Light Tools V3

bull Project templates (VS + Blend)

bull Item templates (VS + Blend)

bull Code snippets

DEMO

MVVM Light ToolkitUnityBlendability

Flaws of MVVM

bullToo much code neededbull INotifyPropertyChangedbullCommands

bullSome operations are tricky (set focushellip)

bullNot applicable to ASPNET etcbullMessage to community is not clear

Debunking the myths

bullldquoNo code in the code behindrdquobull ldquoIf you put code in the Views code-behind the MVVM police will take your family awayrdquo

bull ldquoNo need for convertersrdquo

bullldquoMVVM is only suitable for big projectsrdquo

bullldquoMVVM costs performancerdquobullldquoMVVM is complex makes my head hurtrdquo

Debunking the myths

bullldquoI donrsquot need separation because I donrsquot have a designerrdquo

bullldquoYou cannot use MVVM with other patternsrdquo

bullldquoMVVM will make you rich and attractiverdquo

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 3: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

The MVC pattern

Model View

Controller

The Passive View pattern

Model View

Controller

The Presentation Model pattern

Model View

Presentation Model

(ViewModel)

DataBinding

Blendability

bull Testability Maintainability Blendability

bull ldquoThe ability to be edited in Blendrdquo

bull (and Visual Studio designerhellip)

bull Differentiate code in design and runtime

bull Create design time data

DEMO

Hello MVVM (and Hi Blend)

Bridging the gap

View

ViewModel

DataBinding Commands Messages

Model

Bridging the gap

View

ViewModelView

ViewModel

View

ViewModelMessages

Messages+ callback

Commands

bull ldquoPoint of entryrdquo for a methodrdquo

bull Can be data bound

bull ICommand interface

bull Execute method

bull CanExecute method

bull CanExecuteChanged event handler

DEMO

Commandsand RelayCommands

RelayCommands

RelayCommand MyCommand = new RelayCommand( () =gt () =gt true | false)

RelayCommandltTgt MyGenericCommand = new RelayCommandltTgt( p =gt p =gt true | false)

Messaging

bull Should be simple by default

bull Possible to open filtered channels

bull To a target Type (or an Interface)

bull With a Token

bull With various Messenger instances

bull No constraints at all

DEMOMessaging

Messaging

MessengerDefaultRegisterltTgt( this p =gt DoSomething(p))

MessengerDefaultSendltTgt(p)

MVVM Light Toolkit

bull ldquoBreaking the monotonyrdquo

bull httpwwwgalasoftchmvvmgetstarted

bull httpmvvmlightcodeplexcom

bull V3 released at MIX10bull Keep it smallbull Keep it simple

MVVM Light Libraries V3

bull ESSENTIALSbull RelayCommandbull Messengerbull ViewModelBase

bull EXTRASbull EventToCommandbull DispatcherHelper

MVVM Light Tools V3

bull Project templates (VS + Blend)

bull Item templates (VS + Blend)

bull Code snippets

DEMO

MVVM Light ToolkitUnityBlendability

Flaws of MVVM

bullToo much code neededbull INotifyPropertyChangedbullCommands

bullSome operations are tricky (set focushellip)

bullNot applicable to ASPNET etcbullMessage to community is not clear

Debunking the myths

bullldquoNo code in the code behindrdquobull ldquoIf you put code in the Views code-behind the MVVM police will take your family awayrdquo

bull ldquoNo need for convertersrdquo

bullldquoMVVM is only suitable for big projectsrdquo

bullldquoMVVM costs performancerdquobullldquoMVVM is complex makes my head hurtrdquo

Debunking the myths

bullldquoI donrsquot need separation because I donrsquot have a designerrdquo

bullldquoYou cannot use MVVM with other patternsrdquo

bullldquoMVVM will make you rich and attractiverdquo

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 4: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

The Passive View pattern

Model View

Controller

The Presentation Model pattern

Model View

Presentation Model

(ViewModel)

DataBinding

Blendability

bull Testability Maintainability Blendability

bull ldquoThe ability to be edited in Blendrdquo

bull (and Visual Studio designerhellip)

bull Differentiate code in design and runtime

bull Create design time data

DEMO

Hello MVVM (and Hi Blend)

Bridging the gap

View

ViewModel

DataBinding Commands Messages

Model

Bridging the gap

View

ViewModelView

ViewModel

View

ViewModelMessages

Messages+ callback

Commands

bull ldquoPoint of entryrdquo for a methodrdquo

bull Can be data bound

bull ICommand interface

bull Execute method

bull CanExecute method

bull CanExecuteChanged event handler

DEMO

Commandsand RelayCommands

RelayCommands

RelayCommand MyCommand = new RelayCommand( () =gt () =gt true | false)

RelayCommandltTgt MyGenericCommand = new RelayCommandltTgt( p =gt p =gt true | false)

Messaging

bull Should be simple by default

bull Possible to open filtered channels

bull To a target Type (or an Interface)

bull With a Token

bull With various Messenger instances

bull No constraints at all

DEMOMessaging

Messaging

MessengerDefaultRegisterltTgt( this p =gt DoSomething(p))

MessengerDefaultSendltTgt(p)

MVVM Light Toolkit

bull ldquoBreaking the monotonyrdquo

bull httpwwwgalasoftchmvvmgetstarted

bull httpmvvmlightcodeplexcom

bull V3 released at MIX10bull Keep it smallbull Keep it simple

MVVM Light Libraries V3

bull ESSENTIALSbull RelayCommandbull Messengerbull ViewModelBase

bull EXTRASbull EventToCommandbull DispatcherHelper

MVVM Light Tools V3

bull Project templates (VS + Blend)

bull Item templates (VS + Blend)

bull Code snippets

DEMO

MVVM Light ToolkitUnityBlendability

Flaws of MVVM

bullToo much code neededbull INotifyPropertyChangedbullCommands

bullSome operations are tricky (set focushellip)

bullNot applicable to ASPNET etcbullMessage to community is not clear

Debunking the myths

bullldquoNo code in the code behindrdquobull ldquoIf you put code in the Views code-behind the MVVM police will take your family awayrdquo

bull ldquoNo need for convertersrdquo

bullldquoMVVM is only suitable for big projectsrdquo

bullldquoMVVM costs performancerdquobullldquoMVVM is complex makes my head hurtrdquo

Debunking the myths

bullldquoI donrsquot need separation because I donrsquot have a designerrdquo

bullldquoYou cannot use MVVM with other patternsrdquo

bullldquoMVVM will make you rich and attractiverdquo

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 5: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

The Presentation Model pattern

Model View

Presentation Model

(ViewModel)

DataBinding

Blendability

bull Testability Maintainability Blendability

bull ldquoThe ability to be edited in Blendrdquo

bull (and Visual Studio designerhellip)

bull Differentiate code in design and runtime

bull Create design time data

DEMO

Hello MVVM (and Hi Blend)

Bridging the gap

View

ViewModel

DataBinding Commands Messages

Model

Bridging the gap

View

ViewModelView

ViewModel

View

ViewModelMessages

Messages+ callback

Commands

bull ldquoPoint of entryrdquo for a methodrdquo

bull Can be data bound

bull ICommand interface

bull Execute method

bull CanExecute method

bull CanExecuteChanged event handler

DEMO

Commandsand RelayCommands

RelayCommands

RelayCommand MyCommand = new RelayCommand( () =gt () =gt true | false)

RelayCommandltTgt MyGenericCommand = new RelayCommandltTgt( p =gt p =gt true | false)

Messaging

bull Should be simple by default

bull Possible to open filtered channels

bull To a target Type (or an Interface)

bull With a Token

bull With various Messenger instances

bull No constraints at all

DEMOMessaging

Messaging

MessengerDefaultRegisterltTgt( this p =gt DoSomething(p))

MessengerDefaultSendltTgt(p)

MVVM Light Toolkit

bull ldquoBreaking the monotonyrdquo

bull httpwwwgalasoftchmvvmgetstarted

bull httpmvvmlightcodeplexcom

bull V3 released at MIX10bull Keep it smallbull Keep it simple

MVVM Light Libraries V3

bull ESSENTIALSbull RelayCommandbull Messengerbull ViewModelBase

bull EXTRASbull EventToCommandbull DispatcherHelper

MVVM Light Tools V3

bull Project templates (VS + Blend)

bull Item templates (VS + Blend)

bull Code snippets

DEMO

MVVM Light ToolkitUnityBlendability

Flaws of MVVM

bullToo much code neededbull INotifyPropertyChangedbullCommands

bullSome operations are tricky (set focushellip)

bullNot applicable to ASPNET etcbullMessage to community is not clear

Debunking the myths

bullldquoNo code in the code behindrdquobull ldquoIf you put code in the Views code-behind the MVVM police will take your family awayrdquo

bull ldquoNo need for convertersrdquo

bullldquoMVVM is only suitable for big projectsrdquo

bullldquoMVVM costs performancerdquobullldquoMVVM is complex makes my head hurtrdquo

Debunking the myths

bullldquoI donrsquot need separation because I donrsquot have a designerrdquo

bullldquoYou cannot use MVVM with other patternsrdquo

bullldquoMVVM will make you rich and attractiverdquo

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 6: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

Blendability

bull Testability Maintainability Blendability

bull ldquoThe ability to be edited in Blendrdquo

bull (and Visual Studio designerhellip)

bull Differentiate code in design and runtime

bull Create design time data

DEMO

Hello MVVM (and Hi Blend)

Bridging the gap

View

ViewModel

DataBinding Commands Messages

Model

Bridging the gap

View

ViewModelView

ViewModel

View

ViewModelMessages

Messages+ callback

Commands

bull ldquoPoint of entryrdquo for a methodrdquo

bull Can be data bound

bull ICommand interface

bull Execute method

bull CanExecute method

bull CanExecuteChanged event handler

DEMO

Commandsand RelayCommands

RelayCommands

RelayCommand MyCommand = new RelayCommand( () =gt () =gt true | false)

RelayCommandltTgt MyGenericCommand = new RelayCommandltTgt( p =gt p =gt true | false)

Messaging

bull Should be simple by default

bull Possible to open filtered channels

bull To a target Type (or an Interface)

bull With a Token

bull With various Messenger instances

bull No constraints at all

DEMOMessaging

Messaging

MessengerDefaultRegisterltTgt( this p =gt DoSomething(p))

MessengerDefaultSendltTgt(p)

MVVM Light Toolkit

bull ldquoBreaking the monotonyrdquo

bull httpwwwgalasoftchmvvmgetstarted

bull httpmvvmlightcodeplexcom

bull V3 released at MIX10bull Keep it smallbull Keep it simple

MVVM Light Libraries V3

bull ESSENTIALSbull RelayCommandbull Messengerbull ViewModelBase

bull EXTRASbull EventToCommandbull DispatcherHelper

MVVM Light Tools V3

bull Project templates (VS + Blend)

bull Item templates (VS + Blend)

bull Code snippets

DEMO

MVVM Light ToolkitUnityBlendability

Flaws of MVVM

bullToo much code neededbull INotifyPropertyChangedbullCommands

bullSome operations are tricky (set focushellip)

bullNot applicable to ASPNET etcbullMessage to community is not clear

Debunking the myths

bullldquoNo code in the code behindrdquobull ldquoIf you put code in the Views code-behind the MVVM police will take your family awayrdquo

bull ldquoNo need for convertersrdquo

bullldquoMVVM is only suitable for big projectsrdquo

bullldquoMVVM costs performancerdquobullldquoMVVM is complex makes my head hurtrdquo

Debunking the myths

bullldquoI donrsquot need separation because I donrsquot have a designerrdquo

bullldquoYou cannot use MVVM with other patternsrdquo

bullldquoMVVM will make you rich and attractiverdquo

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 7: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

DEMO

Hello MVVM (and Hi Blend)

Bridging the gap

View

ViewModel

DataBinding Commands Messages

Model

Bridging the gap

View

ViewModelView

ViewModel

View

ViewModelMessages

Messages+ callback

Commands

bull ldquoPoint of entryrdquo for a methodrdquo

bull Can be data bound

bull ICommand interface

bull Execute method

bull CanExecute method

bull CanExecuteChanged event handler

DEMO

Commandsand RelayCommands

RelayCommands

RelayCommand MyCommand = new RelayCommand( () =gt () =gt true | false)

RelayCommandltTgt MyGenericCommand = new RelayCommandltTgt( p =gt p =gt true | false)

Messaging

bull Should be simple by default

bull Possible to open filtered channels

bull To a target Type (or an Interface)

bull With a Token

bull With various Messenger instances

bull No constraints at all

DEMOMessaging

Messaging

MessengerDefaultRegisterltTgt( this p =gt DoSomething(p))

MessengerDefaultSendltTgt(p)

MVVM Light Toolkit

bull ldquoBreaking the monotonyrdquo

bull httpwwwgalasoftchmvvmgetstarted

bull httpmvvmlightcodeplexcom

bull V3 released at MIX10bull Keep it smallbull Keep it simple

MVVM Light Libraries V3

bull ESSENTIALSbull RelayCommandbull Messengerbull ViewModelBase

bull EXTRASbull EventToCommandbull DispatcherHelper

MVVM Light Tools V3

bull Project templates (VS + Blend)

bull Item templates (VS + Blend)

bull Code snippets

DEMO

MVVM Light ToolkitUnityBlendability

Flaws of MVVM

bullToo much code neededbull INotifyPropertyChangedbullCommands

bullSome operations are tricky (set focushellip)

bullNot applicable to ASPNET etcbullMessage to community is not clear

Debunking the myths

bullldquoNo code in the code behindrdquobull ldquoIf you put code in the Views code-behind the MVVM police will take your family awayrdquo

bull ldquoNo need for convertersrdquo

bullldquoMVVM is only suitable for big projectsrdquo

bullldquoMVVM costs performancerdquobullldquoMVVM is complex makes my head hurtrdquo

Debunking the myths

bullldquoI donrsquot need separation because I donrsquot have a designerrdquo

bullldquoYou cannot use MVVM with other patternsrdquo

bullldquoMVVM will make you rich and attractiverdquo

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 8: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

Bridging the gap

View

ViewModel

DataBinding Commands Messages

Model

Bridging the gap

View

ViewModelView

ViewModel

View

ViewModelMessages

Messages+ callback

Commands

bull ldquoPoint of entryrdquo for a methodrdquo

bull Can be data bound

bull ICommand interface

bull Execute method

bull CanExecute method

bull CanExecuteChanged event handler

DEMO

Commandsand RelayCommands

RelayCommands

RelayCommand MyCommand = new RelayCommand( () =gt () =gt true | false)

RelayCommandltTgt MyGenericCommand = new RelayCommandltTgt( p =gt p =gt true | false)

Messaging

bull Should be simple by default

bull Possible to open filtered channels

bull To a target Type (or an Interface)

bull With a Token

bull With various Messenger instances

bull No constraints at all

DEMOMessaging

Messaging

MessengerDefaultRegisterltTgt( this p =gt DoSomething(p))

MessengerDefaultSendltTgt(p)

MVVM Light Toolkit

bull ldquoBreaking the monotonyrdquo

bull httpwwwgalasoftchmvvmgetstarted

bull httpmvvmlightcodeplexcom

bull V3 released at MIX10bull Keep it smallbull Keep it simple

MVVM Light Libraries V3

bull ESSENTIALSbull RelayCommandbull Messengerbull ViewModelBase

bull EXTRASbull EventToCommandbull DispatcherHelper

MVVM Light Tools V3

bull Project templates (VS + Blend)

bull Item templates (VS + Blend)

bull Code snippets

DEMO

MVVM Light ToolkitUnityBlendability

Flaws of MVVM

bullToo much code neededbull INotifyPropertyChangedbullCommands

bullSome operations are tricky (set focushellip)

bullNot applicable to ASPNET etcbullMessage to community is not clear

Debunking the myths

bullldquoNo code in the code behindrdquobull ldquoIf you put code in the Views code-behind the MVVM police will take your family awayrdquo

bull ldquoNo need for convertersrdquo

bullldquoMVVM is only suitable for big projectsrdquo

bullldquoMVVM costs performancerdquobullldquoMVVM is complex makes my head hurtrdquo

Debunking the myths

bullldquoI donrsquot need separation because I donrsquot have a designerrdquo

bullldquoYou cannot use MVVM with other patternsrdquo

bullldquoMVVM will make you rich and attractiverdquo

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 9: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

Bridging the gap

View

ViewModelView

ViewModel

View

ViewModelMessages

Messages+ callback

Commands

bull ldquoPoint of entryrdquo for a methodrdquo

bull Can be data bound

bull ICommand interface

bull Execute method

bull CanExecute method

bull CanExecuteChanged event handler

DEMO

Commandsand RelayCommands

RelayCommands

RelayCommand MyCommand = new RelayCommand( () =gt () =gt true | false)

RelayCommandltTgt MyGenericCommand = new RelayCommandltTgt( p =gt p =gt true | false)

Messaging

bull Should be simple by default

bull Possible to open filtered channels

bull To a target Type (or an Interface)

bull With a Token

bull With various Messenger instances

bull No constraints at all

DEMOMessaging

Messaging

MessengerDefaultRegisterltTgt( this p =gt DoSomething(p))

MessengerDefaultSendltTgt(p)

MVVM Light Toolkit

bull ldquoBreaking the monotonyrdquo

bull httpwwwgalasoftchmvvmgetstarted

bull httpmvvmlightcodeplexcom

bull V3 released at MIX10bull Keep it smallbull Keep it simple

MVVM Light Libraries V3

bull ESSENTIALSbull RelayCommandbull Messengerbull ViewModelBase

bull EXTRASbull EventToCommandbull DispatcherHelper

MVVM Light Tools V3

bull Project templates (VS + Blend)

bull Item templates (VS + Blend)

bull Code snippets

DEMO

MVVM Light ToolkitUnityBlendability

Flaws of MVVM

bullToo much code neededbull INotifyPropertyChangedbullCommands

bullSome operations are tricky (set focushellip)

bullNot applicable to ASPNET etcbullMessage to community is not clear

Debunking the myths

bullldquoNo code in the code behindrdquobull ldquoIf you put code in the Views code-behind the MVVM police will take your family awayrdquo

bull ldquoNo need for convertersrdquo

bullldquoMVVM is only suitable for big projectsrdquo

bullldquoMVVM costs performancerdquobullldquoMVVM is complex makes my head hurtrdquo

Debunking the myths

bullldquoI donrsquot need separation because I donrsquot have a designerrdquo

bullldquoYou cannot use MVVM with other patternsrdquo

bullldquoMVVM will make you rich and attractiverdquo

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 10: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

Commands

bull ldquoPoint of entryrdquo for a methodrdquo

bull Can be data bound

bull ICommand interface

bull Execute method

bull CanExecute method

bull CanExecuteChanged event handler

DEMO

Commandsand RelayCommands

RelayCommands

RelayCommand MyCommand = new RelayCommand( () =gt () =gt true | false)

RelayCommandltTgt MyGenericCommand = new RelayCommandltTgt( p =gt p =gt true | false)

Messaging

bull Should be simple by default

bull Possible to open filtered channels

bull To a target Type (or an Interface)

bull With a Token

bull With various Messenger instances

bull No constraints at all

DEMOMessaging

Messaging

MessengerDefaultRegisterltTgt( this p =gt DoSomething(p))

MessengerDefaultSendltTgt(p)

MVVM Light Toolkit

bull ldquoBreaking the monotonyrdquo

bull httpwwwgalasoftchmvvmgetstarted

bull httpmvvmlightcodeplexcom

bull V3 released at MIX10bull Keep it smallbull Keep it simple

MVVM Light Libraries V3

bull ESSENTIALSbull RelayCommandbull Messengerbull ViewModelBase

bull EXTRASbull EventToCommandbull DispatcherHelper

MVVM Light Tools V3

bull Project templates (VS + Blend)

bull Item templates (VS + Blend)

bull Code snippets

DEMO

MVVM Light ToolkitUnityBlendability

Flaws of MVVM

bullToo much code neededbull INotifyPropertyChangedbullCommands

bullSome operations are tricky (set focushellip)

bullNot applicable to ASPNET etcbullMessage to community is not clear

Debunking the myths

bullldquoNo code in the code behindrdquobull ldquoIf you put code in the Views code-behind the MVVM police will take your family awayrdquo

bull ldquoNo need for convertersrdquo

bullldquoMVVM is only suitable for big projectsrdquo

bullldquoMVVM costs performancerdquobullldquoMVVM is complex makes my head hurtrdquo

Debunking the myths

bullldquoI donrsquot need separation because I donrsquot have a designerrdquo

bullldquoYou cannot use MVVM with other patternsrdquo

bullldquoMVVM will make you rich and attractiverdquo

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 11: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

DEMO

Commandsand RelayCommands

RelayCommands

RelayCommand MyCommand = new RelayCommand( () =gt () =gt true | false)

RelayCommandltTgt MyGenericCommand = new RelayCommandltTgt( p =gt p =gt true | false)

Messaging

bull Should be simple by default

bull Possible to open filtered channels

bull To a target Type (or an Interface)

bull With a Token

bull With various Messenger instances

bull No constraints at all

DEMOMessaging

Messaging

MessengerDefaultRegisterltTgt( this p =gt DoSomething(p))

MessengerDefaultSendltTgt(p)

MVVM Light Toolkit

bull ldquoBreaking the monotonyrdquo

bull httpwwwgalasoftchmvvmgetstarted

bull httpmvvmlightcodeplexcom

bull V3 released at MIX10bull Keep it smallbull Keep it simple

MVVM Light Libraries V3

bull ESSENTIALSbull RelayCommandbull Messengerbull ViewModelBase

bull EXTRASbull EventToCommandbull DispatcherHelper

MVVM Light Tools V3

bull Project templates (VS + Blend)

bull Item templates (VS + Blend)

bull Code snippets

DEMO

MVVM Light ToolkitUnityBlendability

Flaws of MVVM

bullToo much code neededbull INotifyPropertyChangedbullCommands

bullSome operations are tricky (set focushellip)

bullNot applicable to ASPNET etcbullMessage to community is not clear

Debunking the myths

bullldquoNo code in the code behindrdquobull ldquoIf you put code in the Views code-behind the MVVM police will take your family awayrdquo

bull ldquoNo need for convertersrdquo

bullldquoMVVM is only suitable for big projectsrdquo

bullldquoMVVM costs performancerdquobullldquoMVVM is complex makes my head hurtrdquo

Debunking the myths

bullldquoI donrsquot need separation because I donrsquot have a designerrdquo

bullldquoYou cannot use MVVM with other patternsrdquo

bullldquoMVVM will make you rich and attractiverdquo

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 12: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

RelayCommands

RelayCommand MyCommand = new RelayCommand( () =gt () =gt true | false)

RelayCommandltTgt MyGenericCommand = new RelayCommandltTgt( p =gt p =gt true | false)

Messaging

bull Should be simple by default

bull Possible to open filtered channels

bull To a target Type (or an Interface)

bull With a Token

bull With various Messenger instances

bull No constraints at all

DEMOMessaging

Messaging

MessengerDefaultRegisterltTgt( this p =gt DoSomething(p))

MessengerDefaultSendltTgt(p)

MVVM Light Toolkit

bull ldquoBreaking the monotonyrdquo

bull httpwwwgalasoftchmvvmgetstarted

bull httpmvvmlightcodeplexcom

bull V3 released at MIX10bull Keep it smallbull Keep it simple

MVVM Light Libraries V3

bull ESSENTIALSbull RelayCommandbull Messengerbull ViewModelBase

bull EXTRASbull EventToCommandbull DispatcherHelper

MVVM Light Tools V3

bull Project templates (VS + Blend)

bull Item templates (VS + Blend)

bull Code snippets

DEMO

MVVM Light ToolkitUnityBlendability

Flaws of MVVM

bullToo much code neededbull INotifyPropertyChangedbullCommands

bullSome operations are tricky (set focushellip)

bullNot applicable to ASPNET etcbullMessage to community is not clear

Debunking the myths

bullldquoNo code in the code behindrdquobull ldquoIf you put code in the Views code-behind the MVVM police will take your family awayrdquo

bull ldquoNo need for convertersrdquo

bullldquoMVVM is only suitable for big projectsrdquo

bullldquoMVVM costs performancerdquobullldquoMVVM is complex makes my head hurtrdquo

Debunking the myths

bullldquoI donrsquot need separation because I donrsquot have a designerrdquo

bullldquoYou cannot use MVVM with other patternsrdquo

bullldquoMVVM will make you rich and attractiverdquo

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 13: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

Messaging

bull Should be simple by default

bull Possible to open filtered channels

bull To a target Type (or an Interface)

bull With a Token

bull With various Messenger instances

bull No constraints at all

DEMOMessaging

Messaging

MessengerDefaultRegisterltTgt( this p =gt DoSomething(p))

MessengerDefaultSendltTgt(p)

MVVM Light Toolkit

bull ldquoBreaking the monotonyrdquo

bull httpwwwgalasoftchmvvmgetstarted

bull httpmvvmlightcodeplexcom

bull V3 released at MIX10bull Keep it smallbull Keep it simple

MVVM Light Libraries V3

bull ESSENTIALSbull RelayCommandbull Messengerbull ViewModelBase

bull EXTRASbull EventToCommandbull DispatcherHelper

MVVM Light Tools V3

bull Project templates (VS + Blend)

bull Item templates (VS + Blend)

bull Code snippets

DEMO

MVVM Light ToolkitUnityBlendability

Flaws of MVVM

bullToo much code neededbull INotifyPropertyChangedbullCommands

bullSome operations are tricky (set focushellip)

bullNot applicable to ASPNET etcbullMessage to community is not clear

Debunking the myths

bullldquoNo code in the code behindrdquobull ldquoIf you put code in the Views code-behind the MVVM police will take your family awayrdquo

bull ldquoNo need for convertersrdquo

bullldquoMVVM is only suitable for big projectsrdquo

bullldquoMVVM costs performancerdquobullldquoMVVM is complex makes my head hurtrdquo

Debunking the myths

bullldquoI donrsquot need separation because I donrsquot have a designerrdquo

bullldquoYou cannot use MVVM with other patternsrdquo

bullldquoMVVM will make you rich and attractiverdquo

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 14: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

DEMOMessaging

Messaging

MessengerDefaultRegisterltTgt( this p =gt DoSomething(p))

MessengerDefaultSendltTgt(p)

MVVM Light Toolkit

bull ldquoBreaking the monotonyrdquo

bull httpwwwgalasoftchmvvmgetstarted

bull httpmvvmlightcodeplexcom

bull V3 released at MIX10bull Keep it smallbull Keep it simple

MVVM Light Libraries V3

bull ESSENTIALSbull RelayCommandbull Messengerbull ViewModelBase

bull EXTRASbull EventToCommandbull DispatcherHelper

MVVM Light Tools V3

bull Project templates (VS + Blend)

bull Item templates (VS + Blend)

bull Code snippets

DEMO

MVVM Light ToolkitUnityBlendability

Flaws of MVVM

bullToo much code neededbull INotifyPropertyChangedbullCommands

bullSome operations are tricky (set focushellip)

bullNot applicable to ASPNET etcbullMessage to community is not clear

Debunking the myths

bullldquoNo code in the code behindrdquobull ldquoIf you put code in the Views code-behind the MVVM police will take your family awayrdquo

bull ldquoNo need for convertersrdquo

bullldquoMVVM is only suitable for big projectsrdquo

bullldquoMVVM costs performancerdquobullldquoMVVM is complex makes my head hurtrdquo

Debunking the myths

bullldquoI donrsquot need separation because I donrsquot have a designerrdquo

bullldquoYou cannot use MVVM with other patternsrdquo

bullldquoMVVM will make you rich and attractiverdquo

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 15: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

Messaging

MessengerDefaultRegisterltTgt( this p =gt DoSomething(p))

MessengerDefaultSendltTgt(p)

MVVM Light Toolkit

bull ldquoBreaking the monotonyrdquo

bull httpwwwgalasoftchmvvmgetstarted

bull httpmvvmlightcodeplexcom

bull V3 released at MIX10bull Keep it smallbull Keep it simple

MVVM Light Libraries V3

bull ESSENTIALSbull RelayCommandbull Messengerbull ViewModelBase

bull EXTRASbull EventToCommandbull DispatcherHelper

MVVM Light Tools V3

bull Project templates (VS + Blend)

bull Item templates (VS + Blend)

bull Code snippets

DEMO

MVVM Light ToolkitUnityBlendability

Flaws of MVVM

bullToo much code neededbull INotifyPropertyChangedbullCommands

bullSome operations are tricky (set focushellip)

bullNot applicable to ASPNET etcbullMessage to community is not clear

Debunking the myths

bullldquoNo code in the code behindrdquobull ldquoIf you put code in the Views code-behind the MVVM police will take your family awayrdquo

bull ldquoNo need for convertersrdquo

bullldquoMVVM is only suitable for big projectsrdquo

bullldquoMVVM costs performancerdquobullldquoMVVM is complex makes my head hurtrdquo

Debunking the myths

bullldquoI donrsquot need separation because I donrsquot have a designerrdquo

bullldquoYou cannot use MVVM with other patternsrdquo

bullldquoMVVM will make you rich and attractiverdquo

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 16: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

MVVM Light Toolkit

bull ldquoBreaking the monotonyrdquo

bull httpwwwgalasoftchmvvmgetstarted

bull httpmvvmlightcodeplexcom

bull V3 released at MIX10bull Keep it smallbull Keep it simple

MVVM Light Libraries V3

bull ESSENTIALSbull RelayCommandbull Messengerbull ViewModelBase

bull EXTRASbull EventToCommandbull DispatcherHelper

MVVM Light Tools V3

bull Project templates (VS + Blend)

bull Item templates (VS + Blend)

bull Code snippets

DEMO

MVVM Light ToolkitUnityBlendability

Flaws of MVVM

bullToo much code neededbull INotifyPropertyChangedbullCommands

bullSome operations are tricky (set focushellip)

bullNot applicable to ASPNET etcbullMessage to community is not clear

Debunking the myths

bullldquoNo code in the code behindrdquobull ldquoIf you put code in the Views code-behind the MVVM police will take your family awayrdquo

bull ldquoNo need for convertersrdquo

bullldquoMVVM is only suitable for big projectsrdquo

bullldquoMVVM costs performancerdquobullldquoMVVM is complex makes my head hurtrdquo

Debunking the myths

bullldquoI donrsquot need separation because I donrsquot have a designerrdquo

bullldquoYou cannot use MVVM with other patternsrdquo

bullldquoMVVM will make you rich and attractiverdquo

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 17: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

MVVM Light Libraries V3

bull ESSENTIALSbull RelayCommandbull Messengerbull ViewModelBase

bull EXTRASbull EventToCommandbull DispatcherHelper

MVVM Light Tools V3

bull Project templates (VS + Blend)

bull Item templates (VS + Blend)

bull Code snippets

DEMO

MVVM Light ToolkitUnityBlendability

Flaws of MVVM

bullToo much code neededbull INotifyPropertyChangedbullCommands

bullSome operations are tricky (set focushellip)

bullNot applicable to ASPNET etcbullMessage to community is not clear

Debunking the myths

bullldquoNo code in the code behindrdquobull ldquoIf you put code in the Views code-behind the MVVM police will take your family awayrdquo

bull ldquoNo need for convertersrdquo

bullldquoMVVM is only suitable for big projectsrdquo

bullldquoMVVM costs performancerdquobullldquoMVVM is complex makes my head hurtrdquo

Debunking the myths

bullldquoI donrsquot need separation because I donrsquot have a designerrdquo

bullldquoYou cannot use MVVM with other patternsrdquo

bullldquoMVVM will make you rich and attractiverdquo

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 18: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

MVVM Light Tools V3

bull Project templates (VS + Blend)

bull Item templates (VS + Blend)

bull Code snippets

DEMO

MVVM Light ToolkitUnityBlendability

Flaws of MVVM

bullToo much code neededbull INotifyPropertyChangedbullCommands

bullSome operations are tricky (set focushellip)

bullNot applicable to ASPNET etcbullMessage to community is not clear

Debunking the myths

bullldquoNo code in the code behindrdquobull ldquoIf you put code in the Views code-behind the MVVM police will take your family awayrdquo

bull ldquoNo need for convertersrdquo

bullldquoMVVM is only suitable for big projectsrdquo

bullldquoMVVM costs performancerdquobullldquoMVVM is complex makes my head hurtrdquo

Debunking the myths

bullldquoI donrsquot need separation because I donrsquot have a designerrdquo

bullldquoYou cannot use MVVM with other patternsrdquo

bullldquoMVVM will make you rich and attractiverdquo

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 19: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

DEMO

MVVM Light ToolkitUnityBlendability

Flaws of MVVM

bullToo much code neededbull INotifyPropertyChangedbullCommands

bullSome operations are tricky (set focushellip)

bullNot applicable to ASPNET etcbullMessage to community is not clear

Debunking the myths

bullldquoNo code in the code behindrdquobull ldquoIf you put code in the Views code-behind the MVVM police will take your family awayrdquo

bull ldquoNo need for convertersrdquo

bullldquoMVVM is only suitable for big projectsrdquo

bullldquoMVVM costs performancerdquobullldquoMVVM is complex makes my head hurtrdquo

Debunking the myths

bullldquoI donrsquot need separation because I donrsquot have a designerrdquo

bullldquoYou cannot use MVVM with other patternsrdquo

bullldquoMVVM will make you rich and attractiverdquo

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 20: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

Flaws of MVVM

bullToo much code neededbull INotifyPropertyChangedbullCommands

bullSome operations are tricky (set focushellip)

bullNot applicable to ASPNET etcbullMessage to community is not clear

Debunking the myths

bullldquoNo code in the code behindrdquobull ldquoIf you put code in the Views code-behind the MVVM police will take your family awayrdquo

bull ldquoNo need for convertersrdquo

bullldquoMVVM is only suitable for big projectsrdquo

bullldquoMVVM costs performancerdquobullldquoMVVM is complex makes my head hurtrdquo

Debunking the myths

bullldquoI donrsquot need separation because I donrsquot have a designerrdquo

bullldquoYou cannot use MVVM with other patternsrdquo

bullldquoMVVM will make you rich and attractiverdquo

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 21: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

Debunking the myths

bullldquoNo code in the code behindrdquobull ldquoIf you put code in the Views code-behind the MVVM police will take your family awayrdquo

bull ldquoNo need for convertersrdquo

bullldquoMVVM is only suitable for big projectsrdquo

bullldquoMVVM costs performancerdquobullldquoMVVM is complex makes my head hurtrdquo

Debunking the myths

bullldquoI donrsquot need separation because I donrsquot have a designerrdquo

bullldquoYou cannot use MVVM with other patternsrdquo

bullldquoMVVM will make you rich and attractiverdquo

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 22: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

Debunking the myths

bullldquoI donrsquot need separation because I donrsquot have a designerrdquo

bullldquoYou cannot use MVVM with other patternsrdquo

bullldquoMVVM will make you rich and attractiverdquo

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 23: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

DEMO

MVVM on theWindows Phone 7

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25
Page 24: Understanding the MVVM pattern Laurent Bugnion Senior User Experience Integrator IdentityMine http://[blog|www].galasoft.ch

THANKS

httpbloggalasoftch

httpwwwgalasoftchmvvmgetstarted

LBugnion

  • Slide 1
  • Understanding the MVVM pattern
  • What is MVVM
  • The MVC pattern
  • The Passive View pattern
  • The Presentation Model pattern
  • Blendability
  • Hello MVVM (and Hi Blend)
  • Bridging the gap
  • Bridging the gap (2)
  • Commands
  • Commands and RelayCommands
  • RelayCommands
  • Messaging
  • Messaging (2)
  • Messaging (3)
  • MVVM Light Toolkit
  • MVVM Light Libraries V3
  • MVVM Light Tools V3
  • MVVM Light Toolkit Unity Blendability
  • Flaws of MVVM
  • Debunking the myths
  • Debunking the myths (2)
  • MVVM on the Windows Phone 7
  • Slide 25