Paul D. Sheriff PSheriff@pdsa.com www.pdsa.com DEV216 MVVM Made Easy Paul D. Sheriff PSheriff@pdsa.com www.pdsa.com
Paul.About Paul D. Sheriff (psheriff@pdsa.com) Developer Tools President of PDSA, Inc. Author, Speaker, Architect Custom Software Development, Developer Tools Software Audits www.pdsa.com Developer Tools Haystack Code Generator www.CodeHaystack.com .NET Productivity Framework
Agenda What is MVVM? Why use MVVM? Demos 4/24/2017 10:51 AM Agenda What is MVVM? Why use MVVM? Demos Starting with little Data Binding Add More Data Binding Add a View Model © 2004 Microsoft Corporation. All rights reserved. This presentation is for informational purposes only. Microsoft makes no warranties, express or implied, in this summary.
What is MVVM? Model-View-ViewModel Model = Data Class View = User Interface ViewModel (VM) UI binds to this class VM consumes services of Model VM may expose services/properties of Model
What is MVVM? View knows nothing about Model Model knows nothing about View Model knows nothing about View Model View Model knows nothing about View Communication from View to VM is via data binding Lists for List Boxes and Grids IsEnabled properties for Buttons Data for Text Boxes
Why Use MVVM Separate UI / Business / Data Logic Be able to swap out UI Leave business rules/data logic in place ASP.NET to Silverlight WPF to Windows Phone etc. Unit Testing Write less UI code
Demos Data Binding Review Data Binding using Class Searching Sample ViewModel for Add/Edit/Delete screen
Summary MVVM is easy Just need an additional class Helps to understand the XAML data binding model Great for testing and re-usability Don’t worry about being “100% code-behind free”
Thank You Sign up for Haystack Webcasts http://www.pdsa.com/webcasts Sign up for Paul Sheriff's Inner Circle Lifetime membership Over $2000 worth of ebooks, video, etc. http://www.PaulSheriffInnerCircle.com
Sample Code http://www.pdsa.com/TechEd ** Haystack Special ** Get Free Silverlight Video Silverlight XAML for the Complete Novice - Part 1 ** Haystack Special ** Special Price: $499 Use Code: TECHED12 Valid until: 08/01/12
DEV Track Resources Visual Studio Home Page :: http://www.microsoft.com/visualstudio/en-us Somasegar’s Blog :: http://blogs.msdn.com/b/somasegar/ Jason Zander’s Blog :: http://blogs.msdn.com/b/jasonz/ Facebook :: http://www.facebook.com/visualstudio Twitter :: http://twitter.com/#!/visualstudio
Resources Learning TechNet http://northamerica.msteched.com Connect. Share. Discuss. http://northamerica.msteched.com Microsoft Certification & Training Resources www.microsoft.com/learning TechNet Resources for IT Professionals http://microsoft.com/technet Resources for Developers http://microsoft.com/msdn
Complete an evaluation on CommNet and enter to win!
MS Tag Scan the Tag to evaluate this session now on myTechEd Mobile
4/24/2017 10:51 AM © 2012 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION. © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.
4/24/2017 10:51 AM © 2009 Microsoft Corporation. All rights reserved. Microsoft, Windows, Windows Vista and other product names are or may be registered trademarks and/or trademarks in the U.S. and/or other countries. The information herein is for informational purposes only and represents the current view of Microsoft Corporation as of the date of this presentation. Because Microsoft must respond to changing market conditions, it should not be interpreted to be a commitment on the part of Microsoft, and Microsoft cannot guarantee the accuracy of any information provided after the date of this presentation. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.