TechEd 2013 4/4/2019 3:19 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
Building Windows Store Line-of-Business Apps 4/4/2019 3:19 PM DEV-B358 Building Windows Store Line-of-Business Apps Brian Noyes CTO, Solliance Inc. @briannoyes © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
Agenda What is Prism for Windows Runtime MVVM app structuring with Prism Navigation and state management Validation
Business apps for WinRT Business to Consumer (“B2C”) Line of Business (“LOB”)
Prism for Windows Runtime
Prism contents Full, realistic sample application (B2C) – AdventureWorks Shopper Quickstarts Hello World (with and without IOC/DI container) Validation PubSubEvents Documentation
Prism Contents Microsoft.Practices.Prism.StoreApps MVVM Support Navigation Application State management Commands Validation Search / settings charm support / Flyouts Microsoft.Practices.Prism.PubSubEvents Pub/Sub events - EventAggregator
Demo AdventureWorks Shopper 4/4/2019 3:19 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
MVVM app structuring with Prism MvvmAppBase Initializes services, handles app lifecycle, sets up structure for MVVM in app VisualStateAwarePage Integrates with Prism SessionStateService for state management MVVM equivalent of LayoutAwarePage ViewModel Base class for ViewModels Integrates with navigation and state management services ViewModelLocator Automates hookup of Views and ViewModels Overridable conventions for locating ViewModel type and instantiating it
Demo MVVM app structuring with Prism 4/4/2019 3:19 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
Navigation in Prism VisualStateAwarePage VisualStateAwarePage ViewModel ViewModel INavigationService FrameNavigationService Frame
Application Lifecycle Management Windows Store application lifecycle states: Not Running Running Suspended ClosedByUser Terminated Not Running Launch Running Launch Launch Switch Back Switch Apps Terminated Suspended ClosedByUser Shutdown Low Memory
Transient state management Transient app state is managed in ViewModels and Services in MVVM Properties on ViewModels Cached data in client services / repositories Automatically store ViewModel properties [RestorableState] attribute Automatically store client services state ISessionStateService Singleton to inject into any dependent service or class
Demo Navigation and state management 4/4/2019 3:19 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
Validation in WinRT XAML apps Not built in Bindings have no notion of validation Controls have no built in rendering for errors Need to build your own Validation should: Not annoy the user until they have done something wrong Be checked when properties change Allow rules to be defined in a standardized way Including System.ComponentModel.DataAnnotations Support rules attached to Model or ViewModel properties Support displaying errors to the user at the field level or in summary form
Prism validation support BindableValidator Manages a collection of errors per property for a data object Raises events when the errors change to support data binding Can evaluate DataAnnotations automatically ValidatableBindableBase Derives from BindableBase Contains a BindableValidator Exposes errors for data binding Triggers validation when properties change HighlightXYZOnErrors behaviors Attached behaviors to show a red box on control when there are errors associated with the bound property
4/4/2019 3:19 PM Demo Validation © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
Other stuff in Prism Working with Web APIs Platform features CRUD / RPC calls Security Server validation Platform features Search charm Settings charm Flyouts Live Tiles Persistence Client side caching Credential management
Resources Building Windows Store Business Apps with Prism http://tinyurl.com/prismrtcourse WinRT Business Apps with Prism article series http://tinyurl.com/prismrtseries
Resources Learning TechNet msdn http://channel9.msdn.com/Events/TechEd 4/4/2019 3:19 PM Resources Learning Sessions on Demand http://channel9.msdn.com/Events/TechEd Microsoft Certification & Training Resources www.microsoft.com/learning TechNet msdn Resources for IT Professionals http://microsoft.com/technet Resources for Developers http://microsoft.com/msdn © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.
Complete an evaluation on CommNet and enter to win! 4/4/2019 3:19 PM Complete an evaluation on CommNet and enter to win! © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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/4/2019 3:19 PM Required Slide *delete this box when your slide is finalized Your MS Tag will be inserted here during the final scrub. Evaluate this session Scan this QR code to evaluate this session and be automatically entered in a drawing to win a prize © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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/4/2019 3:19 PM © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows 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. © 2013 Microsoft Corporation. All rights reserved. Microsoft, Windows, 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.