• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Silverlight 2.0

Silverlight 2.0



Silverlight 2.0

Silverlight 2.0



Total Views
Views on SlideShare
Embed Views



0 Embeds 0

No embeds



Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
Post Comment
Edit your comment
  • SilverlightWeb Services project
  • Representational State Transfer (REST) is an architectural pattern used in the design of services. REST is about the way in which you expose and make available to callers the contract of the service. REST, therefore, is opposed to SOAP. ADO.NET Data Services’ RESTful interface uses a common URL syntax that clients can learn and leverage across all data services This makes it easy to consume new data services once you’re familiar with the syntax
  • It’s important to note that the “Data” in “Data Services” isn’t referring to a database. A data service is meant to expose data, of any kind over the web, in a standard, and easily consumable fashion. A data service is capable of exposing any object model that contains public properties of type IQueryable. This criteria matches LINQ To SQL, and the Entity Framework, but can just as easily fit a custom object model. Data services implements the Atom Publishing Protocol (AtomPub or APP): Maps HTTP verbs to CRUD operations: GET = Read POST = Create PUT = UpdateDELETE = Delete Exposes the data in the form of Atom feeds and entries
  • http://localhost/AWDataServices/WebDataService.svc/Producthttp://localhost/AWDataServices/WebDataService.svc/Product(324)http://localhost/AWDataServices/WebDataService.svc/Product(324)/Namehttp://localhost/AWDataServices/WebDataService.svc/Product(324)/Name/$valuehttp://localhost/AWDataServices/WebDataService.svc/ProductSubcategory(2)/Producthttp://localhost/AWDataServices/WebDataService.svc/ProductSubcategory(2)/Product(789)/Namehttp://localhost/AWDataServices/WebDataService.svc/Product?$orderby=Namehttp://localhost/AWDataServices/WebDataService.svc/Product?$filter=Color%20eq%20'Black‘http://localhost/AWDataServices/WebDataService.svc/Product?$top=10&$skip=30http://localhost/AWDataServices/WebDataService.svc/ProductSubcategory?$expand=Product
  • http://localhost/AWDataServices/WebDataService.svc/Producthttp://localhost/AWDataServices/WebDataService.svc/Product(324)http://localhost/AWDataServices/WebDataService.svc/Product(324)/Namehttp://localhost/AWDataServices/WebDataService.svc/Product(324)/Name/$valuehttp://localhost/AWDataServices/WebDataService.svc/ProductSubcategory(2)/Producthttp://localhost/AWDataServices/WebDataService.svc/ProductSubcategory(2)/Product(789)/Namehttp://localhost/AWDataServices/WebDataService.svc/Product?$orderby=Namehttp://localhost/AWDataServices/WebDataService.svc/Product?$filter=Color%20eq%20'Black‘http://localhost/AWDataServices/WebDataService.svc/Product?$top=10&$skip=30http://localhost/AWDataServices/WebDataService.svc/ProductSubcategory?$expand=ProductSilverlightADODataServices project
  • SilverlightLocalInteraction project

Silverlight 2.0 Silverlight 2.0 Presentation Transcript

  • Silverlight 2.0
    Dave Allen
    ISV Application Architect
    Developer and Platform Group
    Microsoft UK
  • Agenda
    Web Services
    ADO.NET Data Services
    Isolated Storage
    File Open Dialog
    Background processing
    Host page interaction
  • Web Services
    Supports WCF or ASMX
    bascHttpBinding only
    GET or POST only
    200 and 404 only status codes supported
    SOAP, POX, JSON, or RSS serialization
    X-Domain calls require a Policy file
    All communications have to be asynchronous
  • Demo
    Silverlight 2.0 Web Services
  • ADO.NET Data Services
    Data publishing service using a RESTful interface
    Just uses HTTP
    Therefore is able to use existing authentication mechanisms, and other infrastructure components such as caching and proxies
    Uniform URL Syntax
    Every piece of information is addressable
    Predictable and flexible URL syntax
    Multiple representations
  • ADO.NET Data Services (2)
    Exposes an object model (not a database) over the web
    Entity Data Model – ADO.NET DS designed to work with EDM
    LINQ To SQL model, read-only
    Custom IQueryable<T> provider
    Operation semantics, mapping of HTTP verbs for CRUD operations
    GET – retrieve resource
    POST – create a resource
    PUT – update a resource
    DELETE – delete a resource
  • URL Conventions
    Addressing entities and sets
    Presentation options
  • Demo
    Silverlight & ADO.NET Data Services
  • Isolated Storage
    Ability to interact with local file system
    Virtual file system supporting single files or a directory of files
    Limited size based on quota, default to 1Mb
    Per user, per application or per site/domain
    Can check quota size or available space
    Can be increased through user prompt
  • File Open Dialog
    Prompt users for file names
    Similar to OpenFileDialog in WinForms
    Supports file filters, *.jpg, etc.
    Supports multiple file seclection
    Only have access to file name, not the path
    File is read only
  • Demo
    Isolated Storage and File Open Dialog
  • Background processing
    Keeps the user interface interactive
    Useful when operation length is unknown
    E.g. any outbound network call
    Fits well with Silverlightasync programming model
    Spawn a new thread using BackgroundWorker
  • Demo
    Background processing
  • Host page interaction
    Two-way communication
    Call .NET Silverlight methods from JavaScript
    Call JavaScript funcrtions from Silverlight
    Pass complex structures between them
    .NET Code needs to be attributed
    [ScriptableType] for the class
    [ScriptableMember] for methods and properties
    Scriptable code needs to be registered
  • Host page interaction (2)
    Types in System.Windows.Browser
    Start with an HtmlPage
    Grab an HtmlDocument or HtmlWindow
    Work with HtmlElement instances
    Work with DOM and JavaScript types
    Invoke methods
    GetProperty and SetProperty types
    On an HtmlElement
    GetAttribute and SetAttribute
    AttachEvent and DetachEvent handlers
  • Demo
    Host page interaction