SlideShare a Scribd company logo
 
Silverlight 2 for Developers Jonas Follesø Senior Consultant Capgemini Session Code: WEB304
 
Agenda Blend 2.5 CRUD Designers Patterns Testing Q&A
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 Implement  INotifyPropertyChanged  and use  ObservableCollection<T>  for collections View < ListBox   ItemsSource =&quot;{Binding Path=Dives}&quot; SelectedItem =&quot;{Binding Path=SelectedDive, Mode=TwoWay}&quot; /> Presentation Model State + Operations
Data Binding Implement  INotifyPropertyChanged  and use  ObservableCollection<T>  for collections View XAML Code-Behind Presentation Model public class   PageViewModel  :  INotifyPropertyChanged { public event   PropertyChangedEventHandler  PropertyChanged; public   ObservableCollection < Dive > Dives { ... } public   Dive  SelectedDive { ... } }
IValueConverter Converts data bound values E.g. Bind temperature to color 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 But what about Word? 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 The Presentation Model is  coupled  with both the stub service and the real service. Makes code  less flexible  for change Makes code  harder  to test Object should not be responsible for creating their own dependencies –  Inversion of Control
Dependency Injection (DI) One form of Inversion of Control (IoC)  Create dependencies outside the object and,  inject  them into it But who creates the dependency? Presentation Model public  PageViewModel( IDiveLogServiceClient  proxy) { this. proxy = proxy }
Dependency Injection by hand Should the page be responsible for creating dependencies? 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 What about design time support in Blend? Need to find a way to use IoC and set DataContext declaratively… View < UserControl.DataContext > < dive:PageViewModel  /> </ UserControl.DataContext >
Using DI on the ViewModel
Testing is important!
Testing Silverlight Code The standard solutions do not apply The Silverlight CLR is a subset All networking is asynchronous But it’s still familiar… [TestClass], [TestMethod], [Asynchronous]
Asynchronous Tests How do we “wait” before doing assertions?
Unit Testing in Silverlight
 
Resources www.microsoft.com/teched   Tech·Talks Tech·Ed Bloggers Live Simulcasts Virtual Labs http://microsoft.com/technet   Evaluation licenses, pre-released products, and MORE! http://microsoft.com/msdn   Developer’s Kit, Licenses,  and MORE!
Related Content Code and lots of good resources on  http://jonas.follesoe.no WEB311 Designing Compelling Silverlight User Experiences with Expression Studio 2 Wednesday, 3-9-2008 14:20 - 15:35, NZ Room 4, SkyCity Hands-on Labs (session codes and titles)
Track Resources WEB311 Designing Compelling Silverlight User Experiences with Expression Studio 2 Wednesday, 3-9-2008 14:20 - 15:35, NZ Room 4, SkyCity
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 All diving photos taken by Hege Røkenes and licensed under the creative commons license.  http://flickr.com/photos/hegerokenes/ Photos of Martin Fowler taken by Dave Thomas and licensed under the creative commons license. http://flickr.com/photos/pragdave/
Ad

More Related Content

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
eLink Business Innovations
 
.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
 
Angular Interview Questions & Answers
Angular Interview Questions & AnswersAngular Interview Questions & Answers
Angular Interview Questions & Answers
Ratnala Charan kumar
 
Joel Landis Net Portfolio
Joel Landis Net PortfolioJoel Landis Net Portfolio
Joel Landis Net Portfolio
jlshare
 
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
AnalyticsConf
 
Flex in portal
Flex in portalFlex in portal
Flex in portal
Sunil Patil
 
Groovy in SOAP UI
Groovy in SOAP UIGroovy in SOAP UI
Groovy in SOAP UI
ravireddy76
 
Asp.net mvc training
Asp.net mvc trainingAsp.net mvc training
Asp.net mvc training
icubesystem
 
Angular interview questions
Angular interview questionsAngular interview questions
Angular interview questions
Goa App
 
Quick answers to Angular2+ Interview Questions
Quick answers to Angular2+ Interview QuestionsQuick answers to Angular2+ Interview Questions
Quick answers to Angular2+ Interview Questions
Luis Martín Espino Rivera
 
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
 
Functional programming in C#
Functional programming in C#Functional programming in C#
Functional programming in C#
Thomas Jaskula
 
Asp.NET MVC
Asp.NET MVCAsp.NET MVC
Asp.NET MVC
vrluckyin
 
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
goodfriday
 
Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development Guide
Nitin Giri
 
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
 
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
eLink Business Innovations
 
.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
 
Angular Interview Questions & Answers
Angular Interview Questions & AnswersAngular Interview Questions & Answers
Angular Interview Questions & Answers
Ratnala Charan kumar
 
Joel Landis Net Portfolio
Joel Landis Net PortfolioJoel Landis Net Portfolio
Joel Landis Net Portfolio
jlshare
 
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
AnalyticsConf
 
Groovy in SOAP UI
Groovy in SOAP UIGroovy in SOAP UI
Groovy in SOAP UI
ravireddy76
 
Asp.net mvc training
Asp.net mvc trainingAsp.net mvc training
Asp.net mvc training
icubesystem
 
Angular interview questions
Angular interview questionsAngular interview questions
Angular interview questions
Goa App
 
Quick answers to Angular2+ Interview Questions
Quick answers to Angular2+ Interview QuestionsQuick answers to Angular2+ Interview Questions
Quick answers to Angular2+ Interview Questions
Luis Martín Espino Rivera
 
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
 
Functional programming in C#
Functional programming in C#Functional programming in C#
Functional programming in C#
Thomas Jaskula
 
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
goodfriday
 
Angular workshop - Full Development Guide
Angular workshop - Full Development GuideAngular workshop - Full Development Guide
Angular workshop - Full Development Guide
Nitin Giri
 
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
 

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
Paul Woods
 
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
Intergen
 
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
Shivakumar Vishwanath
 
Data Driven Organization
Data Driven OrganizationData Driven Organization
Data Driven Organization
Bilot
 
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
Solace
 
Wroclaw SAP Meetup - 2016/10
Wroclaw SAP Meetup - 2016/10Wroclaw SAP Meetup - 2016/10
Wroclaw SAP Meetup - 2016/10
Vitaliy Rudnytskiy
 
SCOM-网络分享课模板-APS-20161026-A
SCOM-网络分享课模板-APS-20161026-ASCOM-网络分享课模板-APS-20161026-A
SCOM-网络分享课模板-APS-20161026-A
Ralph Yin
 
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
Heikki Ailisto
 
Webinar - Transforming Manufacturing with IoT
Webinar - Transforming Manufacturing with IoTWebinar - Transforming Manufacturing with IoT
Webinar - Transforming Manufacturing with IoT
HARMAN Services
 
Intelligent Manufacturing - A Smart Choice
Intelligent Manufacturing  - A Smart ChoiceIntelligent Manufacturing  - A Smart Choice
Intelligent Manufacturing - A Smart Choice
Sunil Wadhwa -MIE, EPLM (IIMC)
 
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
Deloitte United States
 
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
 
101 Use Cases for IoT
101 Use Cases for IoT101 Use Cases for IoT
101 Use Cases for IoT
Cisco Canada
 
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)
Étienne Garbugli
 
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
Paul Woods
 
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
Intergen
 
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
Shivakumar Vishwanath
 
Data Driven Organization
Data Driven OrganizationData Driven Organization
Data Driven Organization
Bilot
 
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
Solace
 
SCOM-网络分享课模板-APS-20161026-A
SCOM-网络分享课模板-APS-20161026-ASCOM-网络分享课模板-APS-20161026-A
SCOM-网络分享课模板-APS-20161026-A
Ralph Yin
 
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
Heikki Ailisto
 
Webinar - Transforming Manufacturing with IoT
Webinar - Transforming Manufacturing with IoTWebinar - Transforming Manufacturing with IoT
Webinar - Transforming Manufacturing with IoT
HARMAN Services
 
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
Deloitte United States
 
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
 
101 Use Cases for IoT
101 Use Cases for IoT101 Use Cases for IoT
101 Use Cases for IoT
Cisco Canada
 
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)
Étienne Garbugli
 
Ad

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
ukdpe
 
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
Daniel Fisher
 
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
 
DODN2009 - Jump Start Silverlight
DODN2009 - Jump Start SilverlightDODN2009 - Jump Start Silverlight
DODN2009 - Jump Start Silverlight
Clint Edmonson
 
Silverlight 5 whats new overview
Silverlight 5 whats new overviewSilverlight 5 whats new overview
Silverlight 5 whats new overview
mdc11
 
MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009
Jonas Follesø
 
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
 
Introduction To Dot Net Siddhesh
Introduction To Dot Net SiddheshIntroduction To Dot Net Siddhesh
Introduction To Dot Net Siddhesh
Siddhesh Bhobe
 
Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)
Igor Moochnick
 
PPT
PPTPPT
PPT
webhostingguy
 
Tdd,Ioc
Tdd,IocTdd,Ioc
Tdd,Ioc
Antonio Radesca
 
Introduction to JSF
Introduction toJSFIntroduction toJSF
Introduction to JSF
SoftServe
 
C#Portfolio
C#PortfolioC#Portfolio
C#Portfolio
Jeriel_Mikell
 
Whidbey old
Whidbey old Whidbey old
Whidbey old
grenaud
 
Entity Framework v2 Best Practices
Entity Framework v2 Best PracticesEntity Framework v2 Best Practices
Entity Framework v2 Best Practices
Andri Yadi
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
Sunpawet Somsin
 
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
 
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
ukdpe
 
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
Daniel Fisher
 
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
 
DODN2009 - Jump Start Silverlight
DODN2009 - Jump Start SilverlightDODN2009 - Jump Start Silverlight
DODN2009 - Jump Start Silverlight
Clint Edmonson
 
Silverlight 5 whats new overview
Silverlight 5 whats new overviewSilverlight 5 whats new overview
Silverlight 5 whats new overview
mdc11
 
MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009MVVM Design Pattern NDC2009
MVVM Design Pattern NDC2009
Jonas Follesø
 
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
 
Introduction To Dot Net Siddhesh
Introduction To Dot Net SiddheshIntroduction To Dot Net Siddhesh
Introduction To Dot Net Siddhesh
Siddhesh Bhobe
 
Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)Ado.Net Data Services (Astoria)
Ado.Net Data Services (Astoria)
Igor Moochnick
 
Introduction to JSF
Introduction toJSFIntroduction toJSF
Introduction to JSF
SoftServe
 
Whidbey old
Whidbey old Whidbey old
Whidbey old
grenaud
 
Entity Framework v2 Best Practices
Entity Framework v2 Best PracticesEntity Framework v2 Best Practices
Entity Framework v2 Best Practices
Andri Yadi
 
Introduction to ASP.NET MVC
Introduction to ASP.NET MVCIntroduction to ASP.NET MVC
Introduction to ASP.NET MVC
Sunpawet Somsin
 
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
 
Ad

More from Jonas Follesø (13)

Introduction to F#
Introduction to F#Introduction to F#
Introduction to F#
Jonas Follesø
 
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
Jonas Follesø
 
Introduction to MonoTouch
Introduction to MonoTouchIntroduction to MonoTouch
Introduction to MonoTouch
Jonas Follesø
 
Hvordan lage en vellykket WP7 applikasjon
Hvordan lage en vellykket WP7 applikasjonHvordan lage en vellykket WP7 applikasjon
Hvordan lage en vellykket WP7 applikasjon
Jonas Follesø
 
Why learn new programming languages
Why learn new programming languagesWhy learn new programming languages
Why learn new programming languages
Jonas Follesø
 
Smidig 2011 TDD Workshop
Smidig 2011 TDD WorkshopSmidig 2011 TDD Workshop
Smidig 2011 TDD Workshop
Jonas Follesø
 
Cross platform mobile apps using .NET
Cross platform mobile apps using .NETCross platform mobile apps using .NET
Cross platform mobile apps using .NET
Jonas Follesø
 
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
Jonas Follesø
 
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
Jonas Follesø
 
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
Jonas Follesø
 
Generating characterization tests for legacy code
Generating characterization tests for legacy codeGenerating characterization tests for legacy code
Generating characterization tests for legacy code
Jonas Follesø
 
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
Jonas Follesø
 
Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)
Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)
Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)
Jonas Follesø
 
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
Jonas Follesø
 
Introduction to MonoTouch
Introduction to MonoTouchIntroduction to MonoTouch
Introduction to MonoTouch
Jonas Follesø
 
Hvordan lage en vellykket WP7 applikasjon
Hvordan lage en vellykket WP7 applikasjonHvordan lage en vellykket WP7 applikasjon
Hvordan lage en vellykket WP7 applikasjon
Jonas Follesø
 
Why learn new programming languages
Why learn new programming languagesWhy learn new programming languages
Why learn new programming languages
Jonas Follesø
 
Smidig 2011 TDD Workshop
Smidig 2011 TDD WorkshopSmidig 2011 TDD Workshop
Smidig 2011 TDD Workshop
Jonas Follesø
 
Cross platform mobile apps using .NET
Cross platform mobile apps using .NETCross platform mobile apps using .NET
Cross platform mobile apps using .NET
Jonas Follesø
 
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
Jonas Follesø
 
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
Jonas Follesø
 
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
Jonas Follesø
 
Generating characterization tests for legacy code
Generating characterization tests for legacy codeGenerating characterization tests for legacy code
Generating characterization tests for legacy code
Jonas Follesø
 
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
Jonas Follesø
 
Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)
Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)
Smidig brukeropplevelse med skjermbildeprototyper (Smidig2009)
Jonas Follesø
 

Recently uploaded (20)

UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Drupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy ConsumptionDrupalcamp Finland – Measuring Front-end Energy Consumption
Drupalcamp Finland – Measuring Front-end Energy Consumption
Exove
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
AI Changes Everything – Talk at Cardiff Metropolitan University, 29th April 2...
Alan Dix
 
What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...What is Model Context Protocol(MCP) - The new technology for communication bw...
What is Model Context Protocol(MCP) - The new technology for communication bw...
Vishnu Singh Chundawat
 
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptxIncreasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Increasing Retail Store Efficiency How can Planograms Save Time and Money.pptx
Anoop Ashok
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
Big Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur MorganBig Data Analytics Quick Research Guide by Arthur Morgan
Big Data Analytics Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven InsightsAndrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell: Transforming Business Strategy Through Data-Driven Insights
Andrew Marnell
 
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath MaestroDev Dives: Automate and orchestrate your processes with UiPath Maestro
Dev Dives: Automate and orchestrate your processes with UiPath Maestro
UiPathCommunity
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep DiveDesigning Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
Designing Low-Latency Systems with Rust and ScyllaDB: An Architectural Deep Dive
ScyllaDB
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Linux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdfLinux Professional Institute LPIC-1 Exam.pdf
Linux Professional Institute LPIC-1 Exam.pdf
RHCSA Guru
 
TrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business ConsultingTrsLabs - Fintech Product & Business Consulting
TrsLabs - Fintech Product & Business Consulting
Trs Labs
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-UmgebungenHCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
HCL Nomad Web – Best Practices und Verwaltung von Multiuser-Umgebungen
panagenda
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Enhancing ICU Intelligence: How Our Functional Testing Enabled a Healthcare I...
Impelsys Inc.
 

Silverlight 2 for Developers - TechEd New Zealand 2008

  • 1.  
  • 2. Silverlight 2 for Developers Jonas Follesø Senior Consultant Capgemini Session Code: WEB304
  • 3.  
  • 4. Agenda Blend 2.5 CRUD Designers Patterns Testing Q&A
  • 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. Data Binding Implement INotifyPropertyChanged and use ObservableCollection<T> for collections View < ListBox ItemsSource =&quot;{Binding Path=Dives}&quot; SelectedItem =&quot;{Binding Path=SelectedDive, Mode=TwoWay}&quot; /> Presentation Model State + Operations
  • 26. Data Binding Implement INotifyPropertyChanged and use ObservableCollection<T> for collections View XAML Code-Behind Presentation Model public class PageViewModel : INotifyPropertyChanged { public event PropertyChangedEventHandler PropertyChanged; public ObservableCollection < Dive > Dives { ... } public Dive SelectedDive { ... } }
  • 27. IValueConverter Converts data bound values E.g. Bind temperature to color 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;/>
  • 29. User Interaction But what about Word? View private void btnSave_Clicked( object sender, ExecutedEventArgs e) { (( PageViewModel )DataContext).Save(); }
  • 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. Dealing with dependencies The Presentation Model is coupled with both the stub service and the real service. Makes code less flexible for change Makes code harder to test Object should not be responsible for creating their own dependencies – Inversion of Control
  • 36. Dependency Injection (DI) One form of Inversion of Control (IoC) Create dependencies outside the object and, inject them into it But who creates the dependency? Presentation Model public PageViewModel( IDiveLogServiceClient proxy) { this. proxy = proxy }
  • 37. Dependency Injection by hand Should the page be responsible for creating dependencies? View public Page() { InitializeComponent(); if ( HtmlPage .IsEnabled) this .DataContext = new PageViewModel ( new DiveLogServiceClient ()); else this .DataContext = new PageViewModel ( new ServiceStub ()); }
  • 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. IoC Containers What about design time support in Blend? Need to find a way to use IoC and set DataContext declaratively… View < UserControl.DataContext > < dive:PageViewModel /> </ UserControl.DataContext >
  • 40. Using DI on the ViewModel
  • 42. Testing Silverlight Code The standard solutions do not apply The Silverlight CLR is a subset All networking is asynchronous But it’s still familiar… [TestClass], [TestMethod], [Asynchronous]
  • 43. Asynchronous Tests How do we “wait” before doing assertions?
  • 44. Unit Testing in Silverlight
  • 45.  
  • 46. Resources www.microsoft.com/teched Tech·Talks Tech·Ed Bloggers Live Simulcasts Virtual Labs http://microsoft.com/technet Evaluation licenses, pre-released products, and MORE! http://microsoft.com/msdn Developer’s Kit, Licenses, and MORE!
  • 47. Related Content Code and lots of good resources on http://jonas.follesoe.no WEB311 Designing Compelling Silverlight User Experiences with Expression Studio 2 Wednesday, 3-9-2008 14:20 - 15:35, NZ Room 4, SkyCity Hands-on Labs (session codes and titles)
  • 48. Track Resources WEB311 Designing Compelling Silverlight User Experiences with Expression Studio 2 Wednesday, 3-9-2008 14:20 - 15:35, NZ Room 4, SkyCity
  • 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. Photo Copyright Notices All diving photos taken by Hege Røkenes and licensed under the creative commons license. http://flickr.com/photos/hegerokenes/ Photos of Martin Fowler taken by Dave Thomas and licensed under the creative commons license. http://flickr.com/photos/pragdave/

Editor's Notes

  • #2: 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.