MVVM Made Easy Paul D. Sheriff [email protected] .
-
Upload
leo-garrison -
Category
Documents
-
view
214 -
download
1
Transcript of MVVM Made Easy Paul D. Sheriff [email protected] .
![Page 2: MVVM Made Easy Paul D. Sheriff PSheriff@pdsa.com .](https://reader035.fdocuments.us/reader035/viewer/2022062517/56649f0e5503460f94c23075/html5/thumbnails/2.jpg)
Paul.About
Paul D. Sheriff ([email protected])President of PDSA, Inc.Author, Speaker, ArchitectCustom Software Development, Developer ToolsSoftware Auditswww.pdsa.com
Developer ToolsHaystack Code Generator
www.CodeHaystack.com.NET Productivity Framework
![Page 3: MVVM Made Easy Paul D. Sheriff PSheriff@pdsa.com .](https://reader035.fdocuments.us/reader035/viewer/2022062517/56649f0e5503460f94c23075/html5/thumbnails/3.jpg)
Agenda
What is MVVM?Why use MVVM?Demos
Starting with little Data BindingAdd More Data BindingAdd a View Model
![Page 4: MVVM Made Easy Paul D. Sheriff PSheriff@pdsa.com .](https://reader035.fdocuments.us/reader035/viewer/2022062517/56649f0e5503460f94c23075/html5/thumbnails/4.jpg)
What is MVVM?
Model-View-ViewModelModel = Data ClassView = User InterfaceViewModel (VM)
UI binds to this classVM consumes services of ModelVM may expose services/properties of Model
![Page 5: MVVM Made Easy Paul D. Sheriff PSheriff@pdsa.com .](https://reader035.fdocuments.us/reader035/viewer/2022062517/56649f0e5503460f94c23075/html5/thumbnails/5.jpg)
What is MVVM?
View knows nothing about ModelModel knows nothing about ViewModel knows nothing about View ModelView Model knows nothing about ViewCommunication from View to VM is via data binding
Lists for List Boxes and GridsIsEnabled properties for ButtonsData for Text Boxes
![Page 6: MVVM Made Easy Paul D. Sheriff PSheriff@pdsa.com .](https://reader035.fdocuments.us/reader035/viewer/2022062517/56649f0e5503460f94c23075/html5/thumbnails/6.jpg)
Why Use MVVM
Separate UI / Business / Data LogicBe able to swap out UI
Leave business rules/data logic in placeASP.NET to SilverlightWPF to Windows Phoneetc.
Unit TestingWrite less UI code
![Page 7: MVVM Made Easy Paul D. Sheriff PSheriff@pdsa.com .](https://reader035.fdocuments.us/reader035/viewer/2022062517/56649f0e5503460f94c23075/html5/thumbnails/7.jpg)
Demos
Data Binding ReviewData Binding using ClassSearching SampleViewModel for Add/Edit/Delete screen
![Page 8: MVVM Made Easy Paul D. Sheriff PSheriff@pdsa.com .](https://reader035.fdocuments.us/reader035/viewer/2022062517/56649f0e5503460f94c23075/html5/thumbnails/8.jpg)
Summary
MVVM is easyJust need an additional classHelps to understand the XAML data binding modelGreat for testing and re-usabilityDon’t worry about being “100% code-behind free”
![Page 9: MVVM Made Easy Paul D. Sheriff PSheriff@pdsa.com .](https://reader035.fdocuments.us/reader035/viewer/2022062517/56649f0e5503460f94c23075/html5/thumbnails/9.jpg)
Thank You
Sign up for Haystack Webcastshttp://www.pdsa.com/webcasts
Sign up for Paul Sheriff's Inner CircleLifetime membershipOver $2000 worth of ebooks, video, etc.http://www.PaulSheriffInnerCircle.com
![Page 10: MVVM Made Easy Paul D. Sheriff PSheriff@pdsa.com .](https://reader035.fdocuments.us/reader035/viewer/2022062517/56649f0e5503460f94c23075/html5/thumbnails/10.jpg)
Sample Code
http://www.pdsa.com/TechEdGet Free Silverlight Video
Silverlight XAML for the Complete Novice - Part 1
** Haystack Special **Special Price: $499Use Code: TECHED12Valid until: 08/01/12
![Page 11: MVVM Made Easy Paul D. Sheriff PSheriff@pdsa.com .](https://reader035.fdocuments.us/reader035/viewer/2022062517/56649f0e5503460f94c23075/html5/thumbnails/11.jpg)
DEV Track Resources
Visual Studio Home Page :: http://www.microsoft.com/visualstudio/en-us
Jason Zander’s Blog :: http://blogs.msdn.com/b/jasonz/
Facebook :: http://www.facebook.com/visualstudio
Twitter :: http://twitter.com/#!/visualstudio
Somasegar’s Blog :: http://blogs.msdn.com/b/somasegar/
![Page 12: MVVM Made Easy Paul D. Sheriff PSheriff@pdsa.com .](https://reader035.fdocuments.us/reader035/viewer/2022062517/56649f0e5503460f94c23075/html5/thumbnails/12.jpg)
Resources
Connect. Share. Discuss.
http://northamerica.msteched.com
Learning
Microsoft Certification & Training Resources
www.microsoft.com/learning
TechNet
Resources for IT Professionals
http://microsoft.com/technet
Resources for Developers
http://microsoft.com/msdn
![Page 13: MVVM Made Easy Paul D. Sheriff PSheriff@pdsa.com .](https://reader035.fdocuments.us/reader035/viewer/2022062517/56649f0e5503460f94c23075/html5/thumbnails/13.jpg)
Complete an evaluation on CommNet and enter to win!
![Page 14: MVVM Made Easy Paul D. Sheriff PSheriff@pdsa.com .](https://reader035.fdocuments.us/reader035/viewer/2022062517/56649f0e5503460f94c23075/html5/thumbnails/14.jpg)
MS Tag
Scan the Tagto evaluate thissession now onmyTechEd Mobile
![Page 15: MVVM Made Easy Paul D. Sheriff PSheriff@pdsa.com .](https://reader035.fdocuments.us/reader035/viewer/2022062517/56649f0e5503460f94c23075/html5/thumbnails/15.jpg)
© 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.
![Page 16: MVVM Made Easy Paul D. Sheriff PSheriff@pdsa.com .](https://reader035.fdocuments.us/reader035/viewer/2022062517/56649f0e5503460f94c23075/html5/thumbnails/16.jpg)