Presentation is loading. Please wait.

Presentation is loading. Please wait.

Jordan Knight Solution Architect - Xamling

Similar presentations


Presentation on theme: "Jordan Knight Solution Architect - Xamling"— Presentation transcript:

1 Jordan Knight Solution Architect - Xamling
DEV 324 Windows 8 with a view Jordan Knight Solution Architect - Xamling

2 Hello and Welcome Jordan Knight Solution Architect – Xamling @jakkaj
@jakkaj Silverlight MVP

3 Who we are

4 Windows 8 with a view *not a MVVM intro talk

5 So you’re using MVVM? … or you are about to start using MVVM
… or you’ve heard of MVVM and think it’s a good idea Today we see how to build upon MVVM By adding some conventions and patterns Using super simple techniques And to make life a lot easier for developers and designers To make it easier to build awesome stuff And to maintain a competitive edge

6 Quick MVVM recap Using declarative data binding
View ViewModel Model Model Using declarative data binding So the view chooses where to use the data the view model exposes We decouple the code from the view To introduce better workflows And to reduce complexity

7 Quick MVVM recap It’s not something you install
It’s an idea A set of rules You code without worrying about the view You design without worrying about the code All through databinding et al. End result – awesome Designer/Developer workflow Which is the entire reason Binding’s and MVVM were invented

8 Next up – the “next bit” There is more to a great project than simply mastering MVVM

9 View selection and navigation
When the application needs to go to a new view… What chooses what to show? this.Frame.Navigate(typeof(Page2), SomeData); Why should the view know about any program logic? … and viceversa How do you link up a view model? This is view first navigation and it S.UX.

10 ViewModel first navigation
Create a view model Configure it up nicely Then navigate to the ViewModel The navigation system then uses a convention To find the view An link up the view model

11 The first glimpse in to WTH I’m talking about
ViewModel First The first glimpse in to WTH I’m talking about

12 ViewModel first recap Create a view Create a view model
Ensure the name ends in “View” E.g. HomeView.xaml Create a view model Ensure the name ends in ViewModel E.e. HomeViewModel System detects the name, figures out the View and tells the Frame to navigate to that page Linking up the view model automatically

13 Convention based template selection
What about items in the page For example, a GridView

14 It’s not hard to have a multi content GridView

15 GridView List that contains a series of Groups
Each group has a Title Each group contains a list of child items Each child item should be a view model ‘Cause then we can dynamically choose it’s view

16 Back to convention Create a View Create a ViewModel
This time it’s a UserControl, not a Page Create a ViewModel With the same name except “Model” on the end Dump them in to the Group lists, and let the View side decide what to do with them…

17 Dynamic Content GridView
Plus some other bits and bobs

18 Dynamic content recap Allow dynamic selection of UserControls
Based on ViewModels in the grouped Lists VariableSizedWrapGrid sets out size of grid squares Allow the view model to choose the Grid Spans Step 4 Something Take over the world

19 While we are being all dynamic…
What about semantic zoom? We should be able to use the same controls… Using the DynamicContentControl We can pass through “VisualState” settings Then we can have states in UserControls for Semantic Zoom

20 … and automatic Visual States… maor dynamic
Semantic Zoom … and automatic Visual States… maor dynamic

21 Dynamic States Recap Windows 8 application have a few modes
Don’t re-do your views and models to handle them Another mode is Snapped view Apply similar techniques

22 Again – can be done with little re-work using dynamic this and that
Snapping Again – can be done with little re-work using dynamic this and that

23 One last thing – Dynamic states within ones self
What about choosing a dynamic state within a control E.g. If a park has toilets, show an icon Re-introducing behaviours The DataStateBehavior Use XAML to decide when to switch to a state Based on values from the ViewModel

24 Dynamic States Using behaviours

25 The End @jakkaj Link to TinyURL code here

26 1/16/2019 9:30 PM © 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.


Download ppt "Jordan Knight Solution Architect - Xamling"

Similar presentations


Ads by Google