360 likes | 771 Views
DEV209. From Zero to Silverlight in 75 Minutes. Paul D. Sheriff President – PDSA, Inc. www.pdsa.com psheriff@pdsa.com. Paul.About. Paul D. Sheriff ( psheriff@pdsa.com ) President of PDSA, Inc. Author, speaker, architect Custom software development, developer tools Software Audits
E N D
DEV209 From Zero to Silverlight in 75 Minutes Paul D. Sheriff President – PDSA, Inc. www.pdsa.compsheriff@pdsa.com
Paul.About • Paul D. Sheriff (psheriff@pdsa.com) • President of PDSA, Inc. • Author, speaker, architect • Custom software development, developer tools • Software Audits • www.pdsa.com • Developer tools • Haystack Code Generator • www.CodeHaystack.com • .NET Productivity Framework
Agenda • Silverlight defined • Key XAML concepts • Styles and resources • Demos • Creating a UI using XAML • Creating styles • Basic business controls • List and container controls
Silverlight Defined • Plug in to browsers • Windows/MAC/Linux (Apache) • Runs on all major browsers • Requires users to download Silverlight • Build Rich Internet Applications (RIAs) • Subset of .NET Framework available • Data access via XML/services • No system. Data namespace • Some client-side resource access
Silverlight Defined • Used in combination with ASP.NET • ASP.NET still used for broadest reach • Silverlight for specialized functionality • Silverlight 4 offers offline capability • Can run on desktop • Partial or extended trust modes
Silverlight Defined • Main parts of Silverlight app • App.xaml • Tells application where to start • MainPage.xaml • The default main page • Other .xaml pages as needed • Any other functionality you need in your app • Web page on which to host Silverlight app • .xap file = compiled app, downloaded to client
Uses of Silverlight • Perform animation in web browser • Better UI than possible with ASP.NET • Easier to code than using JavaScript/AJAX • Use C# or VB instead of JavaScript • Present data to user in rich format • Access via web service, WCF, REST, etc.
Tools You Will Use • Visual Studio 2010 • Expression Blend (Optional) • Helps with layout & animation • Silverlight Toolkit (Optional) • Download from CodePlex.com
XAML • XAML (pronounced zammel) • Declarative markup language • Similar to HTML or ASP.NET • Used for… • User interface • Data binding • Styles • Use C# or VB for coding
Basic Building Blocks • User control • Basic building block for re-usable code • Grid • Container for controls • Can define row and columns • Can constrain height & width
Basic Building Blocks • StackPanel • Container for controls • Does not constrain height and width • ListBox • Very flexible • You will use this a lot • DataGrid • Editable grid
Basic Building Blocks • Other normal UI controls • TextBlock – display text (similar to a label) • TextBox • Button • RadioButton • ComboBox • CheckBox • etc.
Margins and Padding • Use margins and padding • Set left, top, right, bottom • Example: margin=“10, 2, 5, 4” • Starts at left and goes clockwise Margin Padding Content Border
Creating a UI Demo…
Styles and Resources • Move attributes to resources section • Can be placed at control or app level • Factor out width, margin, etc. • Similar to a CSS file in a web application
Styles and Resources Demo…
Input/Display Controls • Typical input and display controls • Text block • Check box • Radio button • Password box • Image • Media element
Input/Display Controls • Input and display controls
List Controls • Controls for display lists • Combo box • List box
Container Controls • Controls that contain other controls • Border • Tab • Scroll viewer
Summary • Silverlight gives you rich UI for web • Cross-platform • Easier to code than AJAX/JavaScript • Easier to code than Flash • Use VS.NET, Blend and C#/VB
Thank You • Sign up for Haystack Webcasts • http://www.pdsa.com/webcasts • Sign up for Paul Sheriff's Inner Circle • Lifetime membership • Over $2000 worth of ebooks, video, etc. • http://www.PaulSheriffInnerCircle.com
Generate Data, Entity, Business Classes CRUD stored procedures Service Layer for WCF MVVM, WPF, Silverlight and ASP.NET add, edit, delete forms 30 day Trial www.CodeHaystack.com
Sample Code • http://www.pdsa.com/TechEd • Get free Silverlight video • Silverlight XAML for the complete novice – Part 1 • ** Haystack Special ** • Special price: $499 • Use code: TECHED11 • Valid until: 6/30/2011
Required Slide Speakers, please list the Breakout Sessions, Interactive Discussions, Labs, Demo Stations and Certification Exam that relate to your session. Also indicate when they can find you staffing in the TLC. Related Content • Breakout sessions (session codes and titles) • Interactive sessions (session codes and titles) • Hands-on labs (session codes and titles) • Product demo stations (demo station title and location) • Related certification exam • Find me later at…
Required Slide Track PMs will supply the content for this slide, which will be inserted during the final scrub. Track Resources • Resource 1 • Resource 2 • Resource 3 • Resource 4
Resources • Connect. Share. Discuss. http://northamerica.msteched.com 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/msdn • http://microsoft.com/technet
Required Slide Complete an evaluation on CommNet and enter to win!
Required Slide Your MS Tag will be inserted here during the final scrub. MS Tag Placeholder Slide
© 2011 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.