240 likes | 573 Views
Required Slide. SESSION CODE: DEV313. Making the Most of the Microsoft Silverlight and WPF Designer in Microsoft Visual Studio 2010. Mark Wilson-Thomas & Mark Boulter Program Managers, Silverlight & WPF Designer Team Microsoft Corporation. What You’ll Learn From This Talk.
E N D
Required Slide SESSION CODE: DEV313 Making the Most of the Microsoft Silverlight and WPF Designer in Microsoft Visual Studio 2010 Mark Wilson-Thomas & Mark Boulter Program Managers, Silverlight & WPF Designer Team Microsoft Corporation
What You’ll Learn From This Talk • Visual Studio 2010 WPF and Silverlight Designer Tips and Tricks for Productivity • Using designer features even when editing XAML • Using the data and sample data features of the designer • Common designer load issues and how to avoid them
Demo 1: Using the Properties Window for Fun and Profit, Whether in Design or XAMLView Mark Wilson-ThomasProgram Manager, Silverlight & WPF Designer TeamMicrosoft Corporatio DEMO
Recap: Key Points from Demo 1 • Use the Properties Window to get help and direction whether in the design view or the XAML view • Activate the designer when in a Resource Dictionary or App.xaml to get help from the Properties Window • Answering the question “Why is my button Red” by using Go To Definition • Style IntelliSense • Using multi-select with the Doc Outline to change a value across many elements
Demo 2: Building up a Data Centric ApplicationScaffolding, Sample Data, Customization, Styling Mark BoulterProgram Manager, Silverlight & WPF Designer TeamMicrosoft Corporation DEMO
Recap: Key Points from Demo 2 Use the Data Source Window to quickly create your UI Use the Binding Picker and Sample Data to easily set up and understand your Bindings at design time Use the “Data Can” to find and configure your DataSource Use Find/Apply Styles and Resources with Resource Picker Use Sample Data, a “Debug Converter” and the new Trace options dialog to track down and fix binding errors
How To Make Your Application “Safe for Design Time” Avoiding Common Pitfalls that Stop the Designer Loading Mark BoulterProgram Manager, Silverlight & WPF Designer TeamMicrosoft Corporation DEMO
Things to know • Look @ the help when you get a load error • Your code runs @ design time (but not always) • What does run: Everything that gets created in the XAML • Instances of Controls and UserControls • ValueConverters • Classes referenced as resources • What does not run: The top level thing you are designing • Window, UserControl, Page etc. whenyou are designing it • Your Application class
Common errors • The most common cause of issues is assuming a runtime environment • Examples: • a UserControl instance calling a web service • a ValueConverteraccessing a value that does not exist @ design time • trying to access a resource from code behind that only exists on the real instance • trying to access properties on objects that we don’t create @ design time • trying to read files relative to the application root
Debugging tips • Look @ the exception information in the gold bar • If you get a load failure screen look @ the whole stack trace • Use a second copy of VS to debug the first • Turn off “Just my code” • Add the “Attach to Process” command if needed • Delete the .suo file or bin and obj directories to avoid crashes on start up
Debugging tips • Look @ the exception information in the gold bar • If you get a load failure screen look @ the whole stack trace • Use a second copy of VS to debug the first • Turn off “Just my code” • Add the “Attach to Process” command if needed • Delete the .suo file or bin and obj directories to avoid crashes on start up
How to turn things off • Use DesignerProperties.GetIsInDesignMode (WPF & SL) • Use DesignerProperties.IsInDesignTool (SL) • Use d:DesignInstance or d:DesignData to enable databinding design time without creating instances of your classes
Demo3: How To Make Your Application “Safe for Design Time” Avoiding Common Pitfalls that Stop the Designer Loading DEMO
Recap: Key Points from Demo 3: • Common places where your code can cause issues • Constructors for Hosted Controls (UserControl, Page etc) • Convertors • DataTemplate Selectors • UserControl Load Methods • Use GetIsInDesignMode to branch round code that shouldn’t run at Design Time • Debug design time issues by: • Using the Designer Goldbar • Attaching a second Visual Studio instance
Summary • Use the Prop Window to get help editing and navigating whether using Designer or XAML editor • Use Design Time Data (Sample Data) for a better experience designing your app • Use the Data Sources Window for an easy app scaffolding experience, customize with the Data Binding Picker and Resource Picker • Make your app safe for design time by trapping issues in Constructors and Converters
Useful Resources • WPF and Silverlight Designer Team Blog (Learning,FAQs, Announcements) • Includes a post and source code for the sample application we built • Upcoming post with much more detail on use of Sample Data • http://blogs.msdn.com/wpfsldesigner • Silverlight and WPF Designer Forum • The best place to interact with the team • http://social.msdn.microsoft.com/Forums/en-US/vswpfdesigner • Email: mwthomas@microsoft.com or markbou@microsoft.com • Twitter: @MarkPavWT
Want to change the future of technology? Good. So do we. • Microsoft Developer User Research would like to invite you to participate in Usability studies! • Give us your feedback and help drive innovation • Fill out our survey and sign up to participate in upcoming studies for developers! • Drop it off at our booth-DAT#5-DAT Track within the Yellow area/zone of the TLC • Free Microsoft products for participating • Too busy to fill out the survey? Contact Christine Alluise @ devur@microsoft.com
Required Slide Track PMs will supply the content for this slide, which will be inserted during the final scrub. Track Resources • Visual Studio – http://www.microsoft.com/visualstudio/en-us/ • Soma’s Blog – http://blogs.msdn.com/b/somasegar/ • MSDN Data Developer Center – http://msdn.com/data • ADO.NET Team Blog – http://blogs.msdn.com/adonet • WCF Data Services Team Blog – http://blogs.msdn.com/astoriateam • EF Design Blog – http://blogs.msdn.com/efdesign
Required Slide Resources Learning • Sessions On-Demand & Community • Microsoft Certification & Training Resources www.microsoft.com/teched www.microsoft.com/learning • Resources for IT Professionals • Resources for Developers • http://microsoft.com/technet • http://microsoft.com/msdn
Required Slide Complete an evaluation on CommNet and enter to win!
Sign up for Tech·Ed 2011 and save $500 starting June 8 – June 31st http://northamerica.msteched.com/registration You can also register at the North America 2011 kiosk located at registrationJoin us in Atlanta next year
© 2010 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.