SlideShare a Scribd company logo
1 of 51
 
Silverlight 2 for Developers Jonas Follesø Senior Consultant Capgemini Session Code: WEB304
 
Agenda ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Dive Log App
Outside data Public Internet mashup APIs Existing Intranet services New services you build RSS/Atom Feeds Images Sounds Videos
A bit of history: Silverlight 1 JavaScript HTML ? AJAX  (XmlHttpRequest) 1.0 <XAML/> Public Internet mashup APIs Existing Intranet services New services you build RSS/Atom Feeds Images Sounds Videos
Today: Silverlight 2 2 Managed Code (C#/VB) HTML Public Int e rnet mashup APIs Existing Intr a net services New services you build RSS/Atom Feeds Images Sounds Videos
Services that describe themselves Computer-Readable Metadata (e.g. WSDL) Automatic Proxy Generation WCF SOAP services in the enterprise Services for  your Silverlight project ADO.NET  Data Services SOAP  services on the Internet
Securing Silverlight Services Silverlight will use auth. info in the browser HTML E.g.: ASP.NET  Login User: Password : Credentials Auth info (e.g. cookie) Service calls + Auth info Silverlight code does not normally deal with credentials… DiveLog.com …/Login.aspx ../MyApp.aspx ../MyService.svc
HTTP Requests in Silverlight HttpWebRequest High-level components and User Code Browser Plugin APIs Web Browser - Cookies - Authenticated sessions - Caching - Proxy server to use Windows/Mac Networking Layer Restrictions Restrictions
Blend – The dark is not that scary…
Dive Log UI and Data
Everything in code behind …is probably not a good idea
A team of sad coders and designers
 
Different people reading about MVC in different places take different ideas from it and describe these as “MVC”. Martin Fowler, GUI Architectures Essay
Separated Presentation Patterns
Data & Domain Logic (Model) UI (View) Interaction  (Controller/Presenter)
Represent the  state  and  behavior  of the presentation  independently  of the GUI controls used in the interface. Martin Fowler, Presentation Model Essay
Makes your app easier to design …makes the designers like you
Everything in code-behind Data Model View XAML Code-Behind Event Handlers
Presentation Model Change notification Data-binding and commands Data Model View XAML Code-Behind Presentation Model State + Operations
Dive Log Presentation Model Change notification Data-binding and commands Dive Log Service Dive Log XAML Code-Behind Dive Log View Model State + Operations
Data Binding ,[object Object],View < ListBox   ItemsSource =&quot;{Binding Path=Dives}&quot; SelectedItem =&quot;{Binding Path=SelectedDive, Mode=TwoWay}&quot; /> Presentation Model State + Operations
Data Binding ,[object Object],View XAML Code-Behind Presentation Model public class   PageViewModel  :  INotifyPropertyChanged { public event   PropertyChangedEventHandler  PropertyChanged; public   ObservableCollection < Dive > Dives { ... } public   Dive  SelectedDive { ... } }
IValueConverter ,[object Object],[object Object],public object   Convert( object , value,  Type  targetType,  object  parameter,  CultureInfo  culture) { int  temp = System. Convert .ToInt32(value); Color  color =  Colors .Black; if (temp < 5) color =  Colors .Blue; else if (temp < 20) color =  Colors .Yellow; else  color =  Colors .Red; return new   SolidColorBrush (color); } View < UserControl.Resources > < demo:ColorConverter   x:Key =&quot;colorConverter&quot; /> </ UserControl.Resources > < TextBox   Text =&quot;{Binding Temperature, Mode=TwoWay}&quot;  Background =&quot;{Binding Temperature, Converter={StaticResource colorConverter}}&quot;/>
Building a Presentation Model
User Interaction ,[object Object],View private void  btnSave_Clicked( object  sender,  ExecutedEventArgs  e) { (( PageViewModel )DataContext).Save(); }
Objects are used to represent actions.  A command object  encapsulates  an action and its parameters.  This allows a  decoupling  of the  invoker  of the command and the  handlers  of the command.
Commands in Silverlight View < Button Content =&quot;Save Dives&quot; input:CommandService.Command =&quot;SaveDives&quot; /> Presentation Model public  PageViewModel() { Commands .SaveDives.Executed += new  EventHandler < ExecutedEventArgs >(SaveDives); } private void  SaveDives( object  sender,  ExecutedEventArgs  e) { // code to save dives.. }
The  strategy pattern  is a software design pattern, whereby algorithms can be selected  at runtime . Presentation Model public  PageViewModel() { if ( HtmlPage .IsEnabled) { client =  new   DiveLogServiceClient (); } else { client =  new   ServiceStub (); } }
 
 
Dealing with dependencies ,[object Object],[object Object],[object Object],[object Object]
Dependency Injection (DI) ,[object Object],[object Object],[object Object],Presentation Model public  PageViewModel( IDiveLogServiceClient  proxy) { this. proxy = proxy }
Dependency Injection by hand ,[object Object],View public  Page() { InitializeComponent(); if  ( HtmlPage .IsEnabled) this .DataContext =  new   PageViewModel ( new   DiveLogServiceClient ()); else this .DataContext =  new   PageViewModel ( new   ServiceStub ()); }
IoC Containers Presentation Model [ Inject ] public  PageViewModel( IDiveLogServiceClient  proxy) { this. proxy = proxy } View public  Page() { InitializeComponent(); IKernel  iocContainer =  new   StandardKernel (); this .DataContext = iocContainer.Get< PageViewModel >(); }
IoC Containers ,[object Object],[object Object],View < UserControl.DataContext > < dive:PageViewModel  /> </ UserControl.DataContext >
Using DI on the ViewModel
Testing is important!
Testing Silverlight Code ,[object Object],[object Object],[object Object],[object Object],[object Object]
Asynchronous Tests ,[object Object]
Unit Testing in Silverlight
 
Resources ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Related Content ,[object Object],[object Object],[object Object],[object Object]
Track Resources ,[object Object],[object Object]
Please complete an evaluation
© 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.
Photo Copyright Notices ,[object Object],[object Object]

More Related Content

What's hot

.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
mwillmer
 
ASPNET_MVC_Tutorial_06_CS
ASPNET_MVC_Tutorial_06_CSASPNET_MVC_Tutorial_06_CS
ASPNET_MVC_Tutorial_06_CS
tutorialsruby
 
Frank Mantek Google G Data
Frank Mantek Google G DataFrank Mantek Google G Data
Frank Mantek Google G Data
deimos
 
Udi Dahan Intentions And Interfaces
Udi Dahan Intentions And InterfacesUdi Dahan Intentions And Interfaces
Udi Dahan Intentions And Interfaces
deimos
 
Correlation id token in share point 2010
Correlation id token in share point 2010Correlation id token in share point 2010
Correlation id token in share point 2010
UGAIA
 

What's hot (18)

Introduction to OO, Java and Eclipse/WebSphere
Introduction to OO, Java and Eclipse/WebSphereIntroduction to OO, Java and Eclipse/WebSphere
Introduction to OO, Java and Eclipse/WebSphere
 
.NET Portfolio
.NET Portfolio.NET Portfolio
.NET Portfolio
 
ASPNET_MVC_Tutorial_06_CS
ASPNET_MVC_Tutorial_06_CSASPNET_MVC_Tutorial_06_CS
ASPNET_MVC_Tutorial_06_CS
 
Angular Interview Questions & Answers
Angular Interview Questions & AnswersAngular Interview Questions & Answers
Angular Interview Questions & Answers
 
Joel Landis Net Portfolio
Joel Landis Net PortfolioJoel Landis Net Portfolio
Joel Landis Net Portfolio
 
Wiesław Kałkus: C# functional programming
Wiesław Kałkus: C# functional programmingWiesław Kałkus: C# functional programming
Wiesław Kałkus: C# functional programming
 
Flex in portal
Flex in portalFlex in portal
Flex in portal
 
Groovy in SOAP UI
Groovy in SOAP UIGroovy in SOAP UI
Groovy in SOAP UI
 
Asp.net mvc training
Asp.net mvc trainingAsp.net mvc training
Asp.net mvc training
 
Angular interview questions
Angular interview questionsAngular interview questions
Angular interview questions
 
Quick answers to Angular2+ Interview Questions
Quick answers to Angular2+ Interview QuestionsQuick answers to Angular2+ Interview Questions
Quick answers to Angular2+ Interview Questions
 
Frank Mantek Google G Data
Frank Mantek Google G DataFrank Mantek Google G Data
Frank Mantek Google G Data
 
Udi Dahan Intentions And Interfaces
Udi Dahan Intentions And InterfacesUdi Dahan Intentions And Interfaces
Udi Dahan Intentions And Interfaces
 
Functional programming in C#
Functional programming in C#Functional programming in C#
Functional programming in C#
 
Asp.NET MVC
Asp.NET MVCAsp.NET MVC
Asp.NET MVC
 
Developing ASP.NET Applications Using the Model View Controller Pattern
Developing ASP.NET Applications Using the Model View Controller PatternDeveloping ASP.NET Applications Using the Model View Controller Pattern
Developing ASP.NET Applications Using the Model View Controller Pattern
 
Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development Guide
 
Correlation id token in share point 2010
Correlation id token in share point 2010Correlation id token in share point 2010
Correlation id token in share point 2010
 

Viewers also liked

SCOM-网络分享课模板-APS-20161026-A
SCOM-网络分享课模板-APS-20161026-ASCOM-网络分享课模板-APS-20161026-A
SCOM-网络分享课模板-APS-20161026-A
Ralph Yin
 
IOT and Big Data - The Perfect Marriage
IOT and Big Data - The Perfect MarriageIOT and Big Data - The Perfect Marriage
IOT and Big Data - The Perfect Marriage
Dr. Mazlan Abbas
 
Internet of Things and Big Data: Vision and Concrete Use Cases
Internet of Things and Big Data: Vision and Concrete Use CasesInternet of Things and Big Data: Vision and Concrete Use Cases
Internet of Things and Big Data: Vision and Concrete Use Cases
MongoDB
 
IoT Meets Big Data: The Opportunities and Challenges by Syed Hoda of ParStream
IoT Meets Big Data: The Opportunities and Challenges by Syed Hoda of ParStreamIoT Meets Big Data: The Opportunities and Challenges by Syed Hoda of ParStream
IoT Meets Big Data: The Opportunities and Challenges by Syed Hoda of ParStream
gogo6
 

Viewers also liked (16)

TechEd Australia - OFC102 - Productivity for the ITPro
TechEd Australia - OFC102 - Productivity for the ITProTechEd Australia - OFC102 - Productivity for the ITPro
TechEd Australia - OFC102 - Productivity for the ITPro
 
TechEd NZ 2014: Intelligent Systems Service - Concept, Code and Demo
TechEd NZ 2014: Intelligent Systems Service - Concept, Code and DemoTechEd NZ 2014: Intelligent Systems Service - Concept, Code and Demo
TechEd NZ 2014: Intelligent Systems Service - Concept, Code and Demo
 
SAP TechED Las Vegas 2016- OEM Partnesr SAP HANA Platform Agenda
SAP TechED Las Vegas 2016- OEM Partnesr SAP HANA Platform Agenda SAP TechED Las Vegas 2016- OEM Partnesr SAP HANA Platform Agenda
SAP TechED Las Vegas 2016- OEM Partnesr SAP HANA Platform Agenda
 
Data Driven Organization
Data Driven OrganizationData Driven Organization
Data Driven Organization
 
Devising Your Data Movement Strategy for IoT
Devising Your Data Movement Strategy for IoTDevising Your Data Movement Strategy for IoT
Devising Your Data Movement Strategy for IoT
 
Wroclaw SAP Meetup - 2016/10
Wroclaw SAP Meetup - 2016/10Wroclaw SAP Meetup - 2016/10
Wroclaw SAP Meetup - 2016/10
 
SCOM-网络分享课模板-APS-20161026-A
SCOM-网络分享课模板-APS-20161026-ASCOM-网络分享课模板-APS-20161026-A
SCOM-网络分享课模板-APS-20161026-A
 
Proof of concepts and use cases with IoT technologies
Proof of concepts and use cases with IoT technologiesProof of concepts and use cases with IoT technologies
Proof of concepts and use cases with IoT technologies
 
Webinar - Transforming Manufacturing with IoT
Webinar - Transforming Manufacturing with IoTWebinar - Transforming Manufacturing with IoT
Webinar - Transforming Manufacturing with IoT
 
Intelligent Manufacturing - A Smart Choice
Intelligent Manufacturing  - A Smart ChoiceIntelligent Manufacturing  - A Smart Choice
Intelligent Manufacturing - A Smart Choice
 
The Internet of Things: Exploring revenue generating use cases
The Internet of Things: Exploring revenue generating use casesThe Internet of Things: Exploring revenue generating use cases
The Internet of Things: Exploring revenue generating use cases
 
IOT and Big Data - The Perfect Marriage
IOT and Big Data - The Perfect MarriageIOT and Big Data - The Perfect Marriage
IOT and Big Data - The Perfect Marriage
 
Internet of Things and Big Data: Vision and Concrete Use Cases
Internet of Things and Big Data: Vision and Concrete Use CasesInternet of Things and Big Data: Vision and Concrete Use Cases
Internet of Things and Big Data: Vision and Concrete Use Cases
 
IoT Meets Big Data: The Opportunities and Challenges by Syed Hoda of ParStream
IoT Meets Big Data: The Opportunities and Challenges by Syed Hoda of ParStreamIoT Meets Big Data: The Opportunities and Challenges by Syed Hoda of ParStream
IoT Meets Big Data: The Opportunities and Challenges by Syed Hoda of ParStream
 
101 Use Cases for IoT
101 Use Cases for IoT101 Use Cases for IoT
101 Use Cases for IoT
 
Apply the Lean Startup in B2B to Build Products Businesses Want (Course Slides)
Apply the Lean Startup in B2B to Build Products Businesses Want (Course Slides)Apply the Lean Startup in B2B to Build Products Businesses Want (Course Slides)
Apply the Lean Startup in B2B to Build Products Businesses Want (Course Slides)
 

Similar to Silverlight 2 for Developers - TechEd New Zealand 2008

MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
Thomas Conté
 
D22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source FrameworksD22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source Frameworks
Sunil Patil
 
D22 portlet development with open source frameworks
D22 portlet development with open source frameworksD22 portlet development with open source frameworks
D22 portlet development with open source frameworks
Sunil Patil
 
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan
 
Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)
Igor Moochnick
 
Whidbey old
Whidbey old Whidbey old
Whidbey old
grenaud
 
Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012
daniel plocker
 
What's New for Data?
What's New for Data?What's New for Data?
What's New for Data?
ukdpe
 

Similar to Silverlight 2 for Developers - TechEd New Zealand 2008 (20)

Mike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and PatternsMike Taulty MIX10 Silverlight Frameworks and Patterns
Mike Taulty MIX10 Silverlight Frameworks and Patterns
 
2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with Volta2008 - TechDays PT: Building Software + Services with Volta
2008 - TechDays PT: Building Software + Services with Volta
 
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
MS Day EPITA 2010: Visual Studio 2010 et Framework .NET 4.0
 
D22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source FrameworksD22 Portlet Development With Open Source Frameworks
D22 Portlet Development With Open Source Frameworks
 
D22 portlet development with open source frameworks
D22 portlet development with open source frameworksD22 portlet development with open source frameworks
D22 portlet development with open source frameworks
 
DODN2009 - Jump Start Silverlight
DODN2009 - Jump Start SilverlightDODN2009 - Jump Start Silverlight
DODN2009 - Jump Start Silverlight
 
Silverlight 5 whats new overview
Silverlight 5 whats new overviewSilverlight 5 whats new overview
Silverlight 5 whats new overview
 
MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009
 
Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2Daniel Egan Msdn Tech Days Oc Day2
Daniel Egan Msdn Tech Days Oc Day2
 
Introduction To Dot Net Siddhesh
Introduction To Dot Net SiddheshIntroduction To Dot Net Siddhesh
Introduction To Dot Net Siddhesh
 
Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)
 
PPT
PPTPPT
PPT
 
Tdd,Ioc
Tdd,IocTdd,Ioc
Tdd,Ioc
 
Introduction to JSF
Introduction toJSFIntroduction toJSF
Introduction to JSF
 
C#Portfolio
C#PortfolioC#Portfolio
C#Portfolio
 
Whidbey old
Whidbey old Whidbey old
Whidbey old
 
Entity Framework v2 Best Practices
Entity Framework v2 Best PracticesEntity Framework v2 Best Practices
Entity Framework v2 Best Practices
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
 
Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012Client Object Model - SharePoint Extreme 2012
Client Object Model - SharePoint Extreme 2012
 
What's New for Data?
What's New for Data?What's New for Data?
What's New for Data?
 

More from Jonas Follesø

Introduction to MonoTouch
Introduction to MonoTouchIntroduction to MonoTouch
Introduction to MonoTouch
Jonas Follesø
 

More from Jonas Follesø (13)

Introduction to F#
Introduction to F#Introduction to F#
Introduction to F#
 
Hvordan lage en vellykket Windows Phone 7 App
Hvordan lage en vellykket Windows Phone 7 AppHvordan lage en vellykket Windows Phone 7 App
Hvordan lage en vellykket Windows Phone 7 App
 
Introduction to MonoTouch
Introduction to MonoTouchIntroduction to MonoTouch
Introduction to MonoTouch
 
Hvordan lage en vellykket WP7 applikasjon
Hvordan lage en vellykket WP7 applikasjonHvordan lage en vellykket WP7 applikasjon
Hvordan lage en vellykket WP7 applikasjon
 
Why learn new programming languages
Why learn new programming languagesWhy learn new programming languages
Why learn new programming languages
 
Smidig 2011 TDD Workshop
Smidig 2011 TDD WorkshopSmidig 2011 TDD Workshop
Smidig 2011 TDD Workshop
 
Cross platform mobile apps using .NET
Cross platform mobile apps using .NETCross platform mobile apps using .NET
Cross platform mobile apps using .NET
 
An overview of the Windows Phone 7 platform
An overview of the Windows Phone 7 platformAn overview of the Windows Phone 7 platform
An overview of the Windows Phone 7 platform
 
Windows Phone 7 lyntale fra Grensesnittet Desember 2010
Windows Phone 7 lyntale fra Grensesnittet Desember 2010Windows Phone 7 lyntale fra Grensesnittet Desember 2010
Windows Phone 7 lyntale fra Grensesnittet Desember 2010
 
NNUG Trondheim 30.09.2010 - Windows Phone 7
NNUG Trondheim 30.09.2010 -  Windows Phone 7NNUG Trondheim 30.09.2010 -  Windows Phone 7
NNUG Trondheim 30.09.2010 - Windows Phone 7
 
Generating characterization tests for legacy code
Generating characterization tests for legacy codeGenerating characterization tests for legacy code
Generating characterization tests for legacy code
 
Get a flying start with Windows Phone 7 - NDC2010
Get a flying start with Windows Phone 7 - NDC2010Get a flying start with Windows Phone 7 - NDC2010
Get a flying start with Windows Phone 7 - NDC2010
 
Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)
Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)
Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)
 

Recently uploaded

Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Safe Software
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf[BuildWithAI] Introduction to Gemini.pdf
[BuildWithAI] Introduction to Gemini.pdf
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​Elevate Developer Efficiency & build GenAI Application with Amazon Q​
Elevate Developer Efficiency & build GenAI Application with Amazon Q​
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
ICT role in 21st century education and its challenges
ICT role in 21st century education and its challengesICT role in 21st century education and its challenges
ICT role in 21st century education and its challenges
 
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot ModelMcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Mcleodganj Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
Apidays New York 2024 - APIs in 2030: The Risk of Technological Sleepwalk by ...
 
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers:  A Deep Dive into Serverless Spatial Data and FMECloud Frontiers:  A Deep Dive into Serverless Spatial Data and FME
Cloud Frontiers: A Deep Dive into Serverless Spatial Data and FME
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
Apidays New York 2024 - The Good, the Bad and the Governed by David O'Neill, ...
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
Apidays New York 2024 - Passkeys: Developing APIs to enable passwordless auth...
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 

Silverlight 2 for Developers - TechEd New Zealand 2008

  • 1.  
  • 2. Silverlight 2 for Developers Jonas Follesø Senior Consultant Capgemini Session Code: WEB304
  • 3.  
  • 4.
  • 6. Outside data Public Internet mashup APIs Existing Intranet services New services you build RSS/Atom Feeds Images Sounds Videos
  • 7. A bit of history: Silverlight 1 JavaScript HTML ? AJAX (XmlHttpRequest) 1.0 <XAML/> Public Internet mashup APIs Existing Intranet services New services you build RSS/Atom Feeds Images Sounds Videos
  • 8. Today: Silverlight 2 2 Managed Code (C#/VB) HTML Public Int e rnet mashup APIs Existing Intr a net services New services you build RSS/Atom Feeds Images Sounds Videos
  • 9. Services that describe themselves Computer-Readable Metadata (e.g. WSDL) Automatic Proxy Generation WCF SOAP services in the enterprise Services for your Silverlight project ADO.NET Data Services SOAP services on the Internet
  • 10. Securing Silverlight Services Silverlight will use auth. info in the browser HTML E.g.: ASP.NET Login User: Password : Credentials Auth info (e.g. cookie) Service calls + Auth info Silverlight code does not normally deal with credentials… DiveLog.com …/Login.aspx ../MyApp.aspx ../MyService.svc
  • 11. HTTP Requests in Silverlight HttpWebRequest High-level components and User Code Browser Plugin APIs Web Browser - Cookies - Authenticated sessions - Caching - Proxy server to use Windows/Mac Networking Layer Restrictions Restrictions
  • 12. Blend – The dark is not that scary…
  • 13. Dive Log UI and Data
  • 14. Everything in code behind …is probably not a good idea
  • 15. A team of sad coders and designers
  • 16.  
  • 17. Different people reading about MVC in different places take different ideas from it and describe these as “MVC”. Martin Fowler, GUI Architectures Essay
  • 19. Data & Domain Logic (Model) UI (View) Interaction (Controller/Presenter)
  • 20. Represent the state and behavior of the presentation independently of the GUI controls used in the interface. Martin Fowler, Presentation Model Essay
  • 21. Makes your app easier to design …makes the designers like you
  • 22. Everything in code-behind Data Model View XAML Code-Behind Event Handlers
  • 23. Presentation Model Change notification Data-binding and commands Data Model View XAML Code-Behind Presentation Model State + Operations
  • 24. Dive Log Presentation Model Change notification Data-binding and commands Dive Log Service Dive Log XAML Code-Behind Dive Log View Model State + Operations
  • 25.
  • 26.
  • 27.
  • 29.
  • 30. Objects are used to represent actions. A command object encapsulates an action and its parameters. This allows a decoupling of the invoker of the command and the handlers of the command.
  • 31. Commands in Silverlight View < Button Content =&quot;Save Dives&quot; input:CommandService.Command =&quot;SaveDives&quot; /> Presentation Model public PageViewModel() { Commands .SaveDives.Executed += new EventHandler < ExecutedEventArgs >(SaveDives); } private void SaveDives( object sender, ExecutedEventArgs e) { // code to save dives.. }
  • 32. The strategy pattern is a software design pattern, whereby algorithms can be selected at runtime . Presentation Model public PageViewModel() { if ( HtmlPage .IsEnabled) { client = new DiveLogServiceClient (); } else { client = new ServiceStub (); } }
  • 33.  
  • 34.  
  • 35.
  • 36.
  • 37.
  • 38. IoC Containers Presentation Model [ Inject ] public PageViewModel( IDiveLogServiceClient proxy) { this. proxy = proxy } View public Page() { InitializeComponent(); IKernel iocContainer = new StandardKernel (); this .DataContext = iocContainer.Get< PageViewModel >(); }
  • 39.
  • 40. Using DI on the ViewModel
  • 42.
  • 43.
  • 44. Unit Testing in Silverlight
  • 45.  
  • 46.
  • 47.
  • 48.
  • 49. Please complete an evaluation
  • 50. © 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.
  • 51.

Editor's Notes

  1. 06/04/09 12:30 © 2007 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.