We think you have liked this presentation. If you wish to download it, please recommend it to your friends in any social system. Share buttons are a little bit lower. Thank you!
Presentation is loading. Please wait.
Published byTomas Millhouse
Modified over 4 years ago
© 2012 Autodesk Developing a simple Metro-style application for Windows 8 Kean Walmsley Software Architect, Autodesk
© 2012 Autodesk About the Presenter Kean joined Autodesk in August 1995, and has since worked in a number of different positions and countries (UK, USA, India and Switzerland). He recently moved from the Autodesk Developer Team into the AutoCAD Engineering organisation, where he now works as a Software Architect. Since July 2006 Kean has maintained a development-related blog at: blogs.autodesk.com/through-the-interface blogs.autodesk.com/through-the-interface Kean holds a Licence dInformatique from lUniversité de Paris-Sud and a Masters in Computer Science from the University of Kent at Canterbury.
© 2012 Autodesk Class Summary Covers the basic concepts around the WinRT sub-system of Windows 8, showing how to develop a simple, touch-enabled application that acts as a companion to AutoCAD. We will look at the various contracts available to WinRT developers, and understand the limitations inherent to working inside the WinRT sandbox, including the need for asynchronous calls into many WinRT APIs. The sample covered - while not working directly inside AutoCAD - will extract MRU information related to AutoCAD drawings in a format that can be used by our Metro-style browser application.
© 2012 Autodesk Learning Objectives At the end of this class, you will be able to: Extract MRU information from the Windows Registry, storing it in XML Understand the limitations imposed on applications by WinRT, including the use of asynchronous calls Create a simple, Metro-style MRU browser application Implement contracts to enable search, sharing, settings and snapping
© 2012 Autodesk Introducing Windows 8 and WinRT
© 2012 Autodesk Windows 8 Latest generation of the Windows OS A critical release for Microsoft A bold departure with Windows Runtime, while focusing on legacy Hybrid of touch-oriented and Desktop environments Desktop apps – such as AutoCAD – will work with modest investment More modern apps will work on ARM tablets such as Microsoft Surface Easily adapted to Windows Phone 8
© 2012 Autodesk Windows Runtime – The New Sandbox on the Block Microsofts answer to the Android and iOS execution sandboxes Commonly abbreviated to WinRT.NET was not considered the best technology for targeting mobile Technologically or politically driven? A new layer on top of the Windows OS A set of core API services Can be used from various languages No longer required or possible to use P/Invoke
© 2012 Autodesk WinRT – How it looks different A whole new design language has been created Not only for Windows 8 Also found on Windows Phone, Zune, Xbox Previously known as Metro, but has since been rebranded Metro-style apps became… Modern UI style apps … and more recently… Windows Store apps A full-screen, touch-friendly user experience
© 2012 Autodesk WinRT – How it looks different Inspirations Bauhaus Swiss typography Motion Design Design principles Pride in craftmanship Fast and fluid Authentically digital Do more with less Win as one
© 2012 Autodesk WinRT – How it is different The tools are familiar, but this is pretty different Different object model for OS capabilities Asynchronous operation enforced for anything but instant responses Strict control over disk access Application interop only via contracts or file associations
© 2012 Autodesk The WinRT Object Model But it is.NET or not? No, it isnt, but its made to feel like it Underlying mechanism is actually COM WinRT and CLR type systems are distinct Merged by metadata adapter If coding in.NET, you target the.NETCore CLR profile Only exposes approved APIs You can try to circumvent them, but not if you want to be on the Windows Store
© 2012 Autodesk Asynchronous operations are now the norm Any call that might take over 50ms is now asynchronous-only Means that any long running call doesnt block the UI thread Ensures a fluid UI experience (no more whitened windows) No great coding overhead with async/await Typical code looks like this: var file = await KnownFolders.DocumentsLibrary.GetFileAsync( file.txt );
© 2012 Autodesk Restricted access to the file system Applications can access files in a few locations Modify Package.appmanifest to request… Capabilities to add/change/delete files in specific locations e.g. Documents Library, Removable Storage Declarations associating the app with specific file-types Permissions get requested when installing the app More freedom when handling a user-selected file Selection implies permissions have been granted for that file
© 2012 Autodesk Application interop App interop has been deliberately limited in WinRT Even if underpinnings are based on COM Imposes good behaviour on WinRT apps, but restrictive File system and Registry isolation make it hard to share data WinRT apps can interoperate via the Share contract Apps can be tied together at the user-level via the Share charm e.g. a photo can be shared with an email client WinRT apps can launch the desktop app associated with a file-type
© 2012 Autodesk Additional points about WinRT apps Really intended for lightweight, tablet-focused apps 32-bit only, implicit memory limitations Applications dont even have a close button Termination/resurrection is at the whim of the OS The expectation is not that apps such as AutoCAD get ported And without a WinRT-based AutoCAD, there is no WinRT API for it So what application possibilities are there? Especially with interop being so limited
© 2012 Autodesk What can be done with AutoCAD? Companion apps are an interesting possibility Windows Store apps that complement desktop apps such as AutoCAD A fun example is to browse AutoCADs MRU file data Browsing data is a great use-case for WinRT The WinRT app can launch AutoCAD with a file If AutoCAD is currently associated with the.DWG file-type If the file is located in an accessible location
© 2012 Autodesk Implementing an AutoCAD MRU browser
© 2012 Autodesk Browsing AutoCADs MRU data in WinRT Cannot access MRU data directly from a WinRT app AutoCADs data is in the Registry and therefore not directly accessible A specific export needs to be run from a desktop-hosted app Could be inside AutoCAD or otherwise Write some files that are then loadable from within WinRT With appropriate application permissions, of course Ideally an automatic process Well use a new feature in AutoCAD 2013, the Core Console…
© 2012 Autodesk Extracting AutoCAD MRU data from the Registry Lets build a simple C# app that queries the Registry Writes an XML file with the MRU data Extracts thumbnails from each of the drawings Also copies the drawings to a local folder Contrived example, but allows us to launch The project references AcCoreMgd.dll App will be loadable in AutoCAD and the Core Console Populates a folder thats accessible by the browser app
© 2012 Autodesk Creating the Basic Browser Start with the VS2012 Grid View template A very capable app for data browsing Gives a great deal of basic capabilities From here we can add the various capabilities we need The first step is to get the data into the browser Some work needed to manipulate the data source And then have the XAML bind to it
© 2012 Autodesk Semantic Zoom Pinch-zoom to see data at different levels of detail Very handy for providing a summary view of your data Requires some work in XAML to implement SemanticZoom.ZoomedInView SemanticZoom.ZoomedOutView If using keyboard and mouse Ctrl + mouse-wheel
© 2012 Autodesk Contracts Implement contracts to support Windows 8 charms Share Search Settings All require using the static GetForCurrentView() method On a variety of different classes More on this over the coming slides
© 2012 Autodesk Contracts – Share Implemented by DataTransferManager.DataRequested event Add a handler when your item is created Populate the DataTarget with the data you want to provide Warning: the Mail app is a little strange as a Share target If you add attachments it blanks the Title and Subject Theres a Share Target sample on MSDN that works more predictably
© 2012 Autodesk Contracts – Search Implemented by SearchPane.QuerySubmitted event Add handler when app is launched Generate a group of items that meet the search criteria Navigate to that group so they are displayed in the UI Easy to implement using LINQ var query = from item in Items where item.Content.Contains(queryText) select item;
© 2012 Autodesk Contracts – Settings Implemented by SettingsPane.CommandsRequested event Add handler when app is launched From here you register your commands When your commands event handler fires, update the settings Application.Current.RoamingSettings Follows user between devices via Live ID Adjust the UI as appropriate to reflect changed setting
© 2012 Autodesk Live Tile Notifications Apps can provide notifications to the user via Start screen tiles Tiles can be static or live Different formats to choose from If wide, the user can also choose to make them square Managed via Windows.UI.Notifications.TileUpdateManager Cycles through up to 5 live tiles
© 2012 Autodesk Snapping Two apps docked on the same screen Both WinRT apps or one can be desktop Snapped view up to 320 pixels wide Very handy for companion apps Implemented via XAML (or HTML) Snapped visual style Contains a storyboard animating controls
© 2012 Autodesk Launching Its possible to launch the application associated with a file-type var file = await KnownFolders.DocumentsLibrary.GetFileAsync(A.dwg); await Launcher.LaunchFileAsync(file); The file needs to be in a known, application accessible folder Limits the ability to open files in arbitrary locations Why our MRU extractor makes local copies of DWGs to be browsed/opened
© 2012 Autodesk Summary Windows 8 is new and parts of it are very different Windows RT, the mobile-focused sub-system Windows Store app development familiar but challenging Restrictions intended to improve trust and responsiveness Significant restrictions when looking at desktop app interop Possible to implement interesting new capabilities for companion apps Semantic Zoom Contracts for Search, Share & Settings Live tile notifications, Snapping, Launching
© 2012 Autodesk Autodesk, AutoCAD* [*if/when mentioned in the pertinent material, followed by an alphabetical list of all other trademarks mentioned in the material] are registered trademarks or trademarks of Autodesk, Inc., and/or its subsidiaries and/or affiliates in the USA and/or other countries. All other brand names, product names, or trademarks belong to their respective holders. Autodesk reserves the right to alter product and services offerings, and specifications and pricing at any time without notice, and is not responsible for typographical or graphical errors that may appear in this document. © 2012 Autodesk, Inc. All rights reserved.
© 2011 Autodesk AutoCAD LT ® 2012 Whats New. © 2011 Autodesk AutoCAD LT 2012 | Experience Productivity With AutoCAD LT ® 2012 software, incremental improvements.
Building RADNUG8 – the windows 8 app Part 1 Matt
© 2012 Microsoft Corporation. All rights reserved. Be more productive. Windows 8 helps you get more done in less time.
Brown University Swim Center
Hidden Survey Gems: Using the COGO Editor and Mapcheck Analysis Tools and the New Survey Tools in AutoCAD® Civil 3D® 2013 Shawn Herring Civil Applications.
© 2012 Autodesk SE2070 Unlimited Round-Tripping with the RISA-Revit® Link Matt Brown, P.E. RISA Technologies.
Introduction to the Windows Runtime (WinRT) Ben Dewey Tallan, Inc.
Win8 on Intel Programming Course Desktop : Sensors Cédric Andreolli Intel Software
Getting Started with Fusion 360’s API
© 2012 Autodesk Presenter’s First and Last Name Presenter’s Title AutoCAD ® Architecture 2013 What’s New Image courtesy of Wilson Architects.
© 2011 Autodesk Capitalize on Corridor Improvements in AutoCAD ® Civil 3D ® Don Quinn Civil Engineer / Eagle Point Product Specialist.
© 2012 Autodesk Get Your Head into the Cloud: How to Make Digital Asset Management Work for You Oscar R. Cantu’ Topcon University.
© 2011 Autodesk Organize and Manage Your Intellectual Property with Autodesk® Vault Workgroup Projects Pascal Le Guellec Market Development Consultant,
Using Geotechnical Data in AutoCAD® Civil 3D
© 2012 Autodesk M5935-V Integrating SAP® with AutoCAD® Bill Svokos CIDEON consultant SAP PLM.
© 2012 Autodesk Autodesk® Simulation 360: Taking Full Advantage of the Cloud to Improve your Design Mike Smell Technical Consultant.
© 2011 Autodesk Navigating Through the Corridor using AutoCAD® Civil 3D®.NET API Augusto Goncalves Senior Developer Consultant at Autodesk.
Win8 on Intel Programming Course Modern UI : Features Cédric Andreolli Intel Software.
Platform for Metro Style Apps Michael Platt Senior Director Microsoft Corp.
© 2012 Autodesk Using Autodesk ® Inventor ® for Sales Mark Keenan Business Development, Technicon Systems, Inc.
© 2018 SlidePlayer.com Inc. All rights reserved.