640 likes | 824 Views
APP-211T. Create Metro style apps quickly with built-in controls. Paul Gusmorino Lead Program Manager, Windows 8 Microsoft Corporation. Agenda. What’s new with controls in Windows 8? Walkthrough the built-in controls and their key features Getting started using controls with HTML5 and JS
E N D
APP-211T Create Metro style apps quickly with built-in controls Paul Gusmorino Lead Program Manager, Windows 8 Microsoft Corporation
Agenda • What’s new with controls in Windows 8? • Walkthrough the built-in controls and their key features • Getting started using controls • with HTML5 and JS • with XAML and C#/C++ You’ll leave with examples of how to • Use built-in controls to create great Metro style apps
demo //build/ Conference app What’s new with controls in Windows?
‘Native’ to both HTML and XAML • For XAML • For all controls XAML control model • For HTML and JS • For many control concepts HTML5 standard controls and CSS • For new control concepts Windows Library for JavaScript
Windows Library for JavaScript (WinJS)library for building Metro style apps using JavaScript • Make your apps look and feel great • Matches the Windows Metro design style • Controls for common user experiences • Designed for touch as well as traditional input • Scales across form factors • Build your apps fast and with high quality • Web technologies you’re already familiar with • Modern patterns for responsive, reliable apps • Leverage interactive design tools
Toggle Switch (XAML) XAML: <ToggleSwitch Header="Wi-finetworking" x:Name="MyToggle" /> C#: MyToggle.Toggled += newRoutedEventHandler(ToggleWifi);
Toggle Switch (HTML) • HTML: • <divdata-win-control="WinJS.UI.Toggle" • data-win-options="{title: 'Wi-fi networking'}" • id="myToggle" • </div> JavaScript: WinJS.UI.getControl(myToggle).addEventListener("change", toggleWifi);
Additional benefits • Accessibility • World readiness • Crisp visuals • Performance • Metro style
Best way to implement common UI patterns so you can focus on what makes your app great!
Built-in controls • Everyday widgets • Text editing • Scrolling content • Presenting data • Commanding surfaces
Everyday widgets Button Hyperlink Ratings ListBox Slider Checkbox Combo Box Time Picker Progress Bar Progress Ring Toggle Switch Date Picker Radio Button
Everyday widgets - custom styled Button Hyperlink Ratings ListBox Slider Checkbox Combo Box Time Picker Progress Bar Progress Ring Toggle Switch Date Picker Radio Button
demo SDK sample Everyday widgets
Everyday widgets takeaways • Use the everyday widgets to get a great user experience • Take full advantage of multi-touch screens • Highly flexible styling and customizations • Realize your scenarios and your app’s own ‘look’ • Retain common feel and functionality
Text editing controls Single-Line Text Box Password Clear Button Reveal Button Multi-Line Text Box Rich Text Box
Text editing controls - behaviors Text Selection Cut, Copy, and Paste Mouse & Keyboard Touch Spellchecking
demo //build/ Conference app Text editing
demo SDK sample Text editing
Text editing controls takeaways • Powerful text editing experience • Optimized for touch, mouse, and keyboard • Spellchecking! • Integration with touch keyboard
Scrolling content with ScrollView • Idle • No scrollbar • Touch & keyboard • Panning indicator • Mouse • Scrollbar
Scrolling content with ScrollView • Panning • Zooming • Rails • Inertia • Boundary feedback • Snap points • Nesting • Chaining
demo Memories Scrolling content: pan
demo Measure-It! Scrolling content: zoom
demo Air Craft Scrolling content: snap points
Scrolling content takeaways • Use the built-in scroll views to get the right user experience • Works for touch, mouse, and keyboard • Achieve sticks-to-the-finger performance • For XAML, use ScrollView control • For HTML, use CSS overflow to get “ScrollView”
Presenting data controls List View Grid View Flip View
Presenting data controls Grouping Single & Multi Select Built-in Animations
demo Flash Cards Presenting data
demo News Presenting data
demo Memories Presenting data
demo //build/ Conference app Presenting data
ListView data templating (HTML) • <divdata-win-control="WinJS.Binding.Template"id="myTemplate"> • <divstyle="width:110px; margin:10px"> • <imgdata-win-bind="src: picture" style="height: 60px; width: 60px"/> • <input type="button"data-win-bind="value:buttonText"/> • </div> • </div> • <divheight="400" • data-win-control="WinJS.UI.ListView" id="listview1" • data-win-options="{dataSource: myData, itemRenderer: myTemplate}"> • </div>
ListViewdata templating (XAML) • <DataTemplate x:Key="MyTemplate"> • <Grid Width="110" Margin="10,10,10,10"> • <Image Source="{Binding Image}" Height="60" Width="60"> • <ButtonContent="{BindingButtonText}" > • </Grid> • </DataTemplate> • <GridHeight="400"> • <GridView x:Name="ListView1"Width="Auto" Height="Auto” • ItemTemplate="{StaticResourceMyTemplate}" /> • </Grid>
Presenting data controls takeaways • Visible way to make your app shine with the Metro design style • Consistent interaction model and behaviors built in • Use list/grid views for collections of data • Define your own rich templates ‘natively’ in both HTML and XAML • Connect to your own data: local or cloud • Use semantic zoom to scale experience to more data
Commanding surfaces App Bar Settings Pane Flyout Context Menu Tooltip Message Dialog
demo Notespace Commanding surfaces – app Bar
demo Weather Commanding surfaces – Flyout