Building a Twitter App with Silverlight 3 - Part 1

17
1 Building a Twitter App with Silverlight 3 Clint Edmonson Developer Evangelist [email protected] www.notsotrivial.net Part 1

description

In this session, we cover what Microsoft Silverlight is and explain how you can capitalize on its capabilities to easily create browser-based applications. Join us to see the powerful media and graphics capabilities Silverlight offers, and the compelling Web sites that have been created with it. Silverlight also has strong data capabilities, making it attractive for building line-of-business (LOB) applications. In this first of two sessions on building a Twitter application in Silverlight 3, we provide a quick overview of the Silverlight platform and then get hands on by putting together an application that consumes server-side data and contains some simple navigation. Presenter: Clint Edmonson, Senior Architect Evangelist, Microsoft Corporation Clint Edmonson is an architect evangelist in the Microsoft North Central district, working with aspiring and seasoned architects to understand the latest Microsoft developer and platform offerings and to develop strategic road maps for their adoption.

Transcript of Building a Twitter App with Silverlight 3 - Part 1

Page 1: Building a Twitter App with Silverlight 3 - Part 1

1

Building a Twitter App with Silverlight 3

Clint EdmonsonDeveloper [email protected]

Part 1

Page 2: Building a Twitter App with Silverlight 3 - Part 1

Introduction

• Session Objectives– Learn about the features available in Silverlight– Gain techniques for getting started and using Silverlight in

your site

• Agenda– What is Silverlight?– Navigation Applications– Database access– Web Services

Page 3: Building a Twitter App with Silverlight 3 - Part 1

What is RIA and Silverlight?

• Rich Internet Applications (RIA)- Vector graphics and animation- Client side storage- Video and audio playback

• Silverlight- Based on WPF- .NET Framework- Develop using Visual Studio

Page 4: Building a Twitter App with Silverlight 3 - Part 1

Silverlight Versions

• Silverlight 1.0– Shipped September 2007– XAML rendering and JavaScript API

• Silverlight 2– Shipped October 2008– XAML enhancements, .NET Framework, C#

• Silverlight 3– Shipped July 2009– Lots of UX enhancements and more

• Silverlight 4– Details are starting to emerge

Page 5: Building a Twitter App with Silverlight 3 - Part 1

The Silverlight Plug-in

• Runs on PC and Intel Macs (Linux with Moonlight)• Supports IE, Firefox, Safari• Under 5 MB download• Installs in seconds

Page 6: Building a Twitter App with Silverlight 3 - Part 1

CoreCLR and BCL

• CoreCLR– Silverlight’s version of the

Common Language Runtime– Based on the desktop CLR– Runs on Mac– Does not require the

desktop .NET Framework to be installed

• Silverlight Base Class Library (BCL)

– Trimmed down, What’s there works the same

Page 7: Building a Twitter App with Silverlight 3 - Part 1

XAML

• Similar to HTML in concept• Language independent• Strong support for data binding• Designer tool friendly

<Canvas Width="300" Height="300" xmlns="http://schemas.microsoft.com/client/2007" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> <Ellipse Canvas.Left="20" Canvas.Top="20" Height="200" Width="200" Stroke="Black" StrokeThickness="10" Fill="Yellow" /> <Ellipse Canvas.Left="80" Canvas.Top="80" Height="35" Width="25" Stroke="Black" Fill="Black" /> <Ellipse Canvas.Left="140" Canvas.Top="80" Height="35" Width="25" Stroke="Black" Fill="Black" /> <Path Data="M 70, 150 A 60, 60 0 0 0 170, 150" Stroke="Black" StrokeThickness="15" StrokeStartLineCap="Round" StrokeEndLineCap="Round" /></Canvas>

Page 8: Building a Twitter App with Silverlight 3 - Part 1

Naming XAML Elements

• Uses the x:Name syntax• Helps to access elements from code• Generates code in InitializeComponent() method

<Rectangle Canvas.Left="50" Canvas.Top="50" Fill="Yellow" Width="300" Height="200" Stroke="Black" StrokeThickness="10" x:Name="YellowRect" />

Page 9: Building a Twitter App with Silverlight 3 - Part 1

Silverlight Navigation

• New for Silverlight 3• Navigation project

template• Pages and Frames• UriMapper• Deep Linking

Page 10: Building a Twitter App with Silverlight 3 - Part 1

Silverlight Navigation Application

DEMO

Page 11: Building a Twitter App with Silverlight 3 - Part 1

Data Access

• Web Services(WCF/SOAP/REST)• Raw TCP/IP Sockets• HttpWebRequest/WebClient• JSON and XML parsing• RSS• HTML DOM Bridge

Page 12: Building a Twitter App with Silverlight 3 - Part 1

ASP.NET Data Integration

• WCF SOAP Services• ADO.NET Data Services• .NET RIA Services

Page 13: Building a Twitter App with Silverlight 3 - Part 1

ADO.NET Data Services

DEMO

Page 14: Building a Twitter App with Silverlight 3 - Part 1

Cross Domain Requests

• Http requests require clientaccesspolicy.xml or crossdomain.xml in root of remote site.

• Can work around by calling through Javascript - not recommended

• Create proxy to funnel requests through

Page 15: Building a Twitter App with Silverlight 3 - Part 1

Web Services

DEMO

Page 16: Building a Twitter App with Silverlight 3 - Part 1

Resources

• Slides & Code: www.notsotrivial.net

• Silverlight Development Center http://www.silverlight.net/

Page 17: Building a Twitter App with Silverlight 3 - Part 1

© 2008 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.