Silverlight 2 by bestt571

VIEWS: 21 PAGES: 33

More Info
									     Silverlight 2

Rich Internet Applications
         mit .NET
     max.knor@microsoft.com
   http://blogs.msdn.com/knom/
    Silverlight 2 Runtime Features
2D, Graphics              .NET Support*
Audio, Video                 C# and VB.NET*
Animations                LINQ*
Text, Text Input*         XML APIs*
                          Generics*
Controls*
                          HTML Integration*
Layout*
                             JSON Serializer
Styles/Templates*         Local storage*
Data Binding*             Crypto APIs (AES)*
Networking                Threading*
    HTTP/S and Sockets*             * New in Silverlight 2
        Silverlight 2 SDK Libraries
• Dynamic Languages*
    – JScript
    – IronRuby
    – IronPython
•   Additional Controls*
•   LINQ for XML*
•   XML Serialization*
•   Syndication APIs (RSS)*
                              * New in Silverlight 2
            Silverlight Roadmap
• Silverlight V1 Shipped Q307
• Silverlight V2
  – March 5th:     Beta 1 (non-commercial go-live)
  – Q208:          Beta 2 (go live)


• Tools
  – Expression Suite and Visual Studio updates for all
    public Silverlight releases
  – Visual Studio Designer support (Cider) later this year
            Build an Application
•   Step 1: Get Data
•   Step 2: Convert XML data to .NET objects
•   Step 3: Build Main (Master) View
•   Step 4: Create a Details View
•   Step 5: Add Search and UX Animations
          Build an Application
• Step 1: Get Data
  – Network data from site of origin
  – Network data from cross domain (x-domain)
  – Local data
            Silverlight Sandbox
• Browser Sandbox “captures” Silverlight
• Sandbox cannot be extended
• Silverlight extends in a secure way
  – Local storage (isolated storage)
  – FileOpen dialog
  – Sockets
  – Cross domain HTTP(S) requests
          Build an Application
• Step 1: Get Data
  – Get data from http://catalog.video.msn.com/
  – Secured via a Silverlight policy file
        demo

Networking
           Build an Application
• Step 1: Get Data
• Step 2: Convert XML data to .NET objects
  – Options:
     • LINQ to XML
     • XMLReader
     • XML Serialization
                demo

Convert XML to Objects
(XML -> List<VideoInfo>)
          Build an Application
• Step 1: Get Data
• Step 2: Convert XML data to .NET objects
• Step 3: Build Main (Master) View
                      Beta 1 Controls
•   Canvas                         •   CheckBox*
•   FileOpenDialog                 •   DataGrid*
•   Grid                           •   DateTimePicker*
•   Image                          •   GridSplitter*
•   ItemsControl                   •   Hyperlink*
•   MediaElement                   •   ListBox*
•   MultiScaleImage                •   Calendar*
•   StackPanel                     •   RadioButton*
•   TextBox                        •   Slider*
•   TextBlock                      •   ToggleButton*
•   Button                         •   Tooltip*
•   Popup                          •   WatermarkTextBox*
                          * ship in a separate library
                      Layout
• Layout containers
  – Canvas, Grid, StackPanel, Border
• Layout properties
  – Width, MinWidth, MaxWidth, ActualWidth
  – Height, MinHeight, MaxHeight, ActualHeight
  – Margin and Padding
• Layout extensibility
              Data Binding
• Property Binding
  – One way, two way and one time
  – Use “DataContext” property
  – Supports value converters
• Collection/List Binding
  – Support data templates (repeater)
  – Use “ItemsSource” property
    List Binding with Data Templates
•   Data Template:




•   Data (.NET Object):
    {{FileName=“Html.html”, FileImageUrl=“html.jpg”},
    {FileName=“Image.jpg”, FileImageUrl=“jpg.jpg”}}

•   Bind using ItemsControl (List Control):
          Build an Application
• Step 1: Get Data
• Step 2: Convert XML data to .NET objects
• Step 3: Build Main (Master) View
  – Use Data Binding, Layout and Templates
           demo

Build the Views
            Build an Application
•   Step 1: Get Data
•   Step 2: Convert XML data to .NET objects
•   Step 3: Build Main (Master) View
•   Step 4: Creating a Detail View
    – Make a re-usable control
• Step 5: Additional Features
               Local Storage
• Cookies on steroids
• Provides 10MB of app specific local storage
• Can be expanded per app by prompting the
  user
• Uses .NET IsolatedStorage APIs
               demo

Storing Previous Search
             Open File Dialog
• Allows an end-user to choose a file
• Application gets access to a stream
• Supports multi-selection and file extension
  filtering
• Enables:
  – File uploading (w/ HttpWebRequest)
  – Viewing local images (w/ Image element)
  – Playing local media (w/ MediaElement)
              demo

Local Video Playback
        HTML DOM Integration
• Silverlight apps are browser apps
• Interacting with the browser host is critical
  – Interact with HTML elements and script objects
    through .NET code
  – Expose .NET objects to javascript
             demo

HTML DOM Integration
           Image Deep Zoom
• Seamless viewing & zooming of huge
  images
• Loads only necessary parts for viewing
• Large image --> scaling vector
           Image Deep Zoom
• Preprocessing tool
  breaks image into 256 x
  256 tiles
• Generates pyramids of
  tiles at lower
  resolutions
 Deep Zoom – How does it work?
• Lowest resolution displayed first
• Background download of higher quality
  tiles --> faded in smoothly
 Deep Zoom – How does it work?
• Lowest resolution displayed first
• Background download of higher quality
  tiles --> faded in smoothly
 Deep Zoom – How does it work?
• Lowest resolution displayed first
• Background download of higher quality
  tiles --> faded in smoothly
           Image Deep Zoom
• Exposed through the MultiScaleImage
• Preprocessing tool outputs image tiles and
  XML description file
                 .NET Events
• Big>Days 2008 (8.April in Wien)
  – http://www.microsoft.com/austria/events/bigdays/


• MSDN Briefings (monthly)
  – http://blogs.msdn.com/msdnat/


• .NET Usergroups
  – http://www.usergroups.at

								
To top