SlideShare a Scribd company logo
1 of 9
Data Binding in Silverlight Mahender Senior Software Engineer United Health Group
Mahender Sarangam Having close to 5 years of experience. Working as a Senior Software Engineer in United Health Group. Good Knowledge on C#, ASP.NET, Silverlight, WPF ,SQL Server, Team Foundation Server(TFS) and SharePoint Technology. MCTS Certified in Web Technologies.
Data Binding  Data binding is a mechanism for moving the data from objects into UI controls. Data binding is a key in Silverlight that allows data shown on UI and then process changes.  Data binding is a process that tells Silverlight to extract a property value from a source object and use it to set a property in a target object. Here Target Object which inherit from Dependency Object and its property must be a Dependency property. Data Binding works with Public properties of Source object. It does not work for fields.
Data Binding We use Binding expression for binding Source property to Target property. Here we don’t mention source object which contain data. Generally in WPF/Silverlight, control uses Data context as Source Object or try to use source property of Binding expression. <UserControl.Resources> <local:Product x:Key="resourceProduct" ModelNumber="AEFS100" ModelName="Portable Defibrillator" UnitCost="77" Description="Analyzes the electrical activity of a person's heart and applies an electric shock if necessary."> </local:Product> </UserControl.Resources> <TextBox Text="{Binding ModelNumber, Source={StaticResourceresourceProduct} }“></TextBox>
INotify Property Changed The INotifyPropertyChanged interface is a key part of the data binding infrastructure available in Silverlight. It contains a single event named PropertyChanged that is used to notify objects when a particular property value changes.
Data Context Data Context: The Data Context refers to a source of data that can be bound to a target. The Data Context often is set to an instance of an entity Data Context is inherited to child elements and this makes it ideal for scenarios where you want to bind multiple elements to a single data source. Data Context is a property of Framework Element We use Binding expression for binding Source property to Target property
Target Null Value and Fall Back values Target Null values are default values i.e. when bound data is NULL or there may be cases where value bounded is NULL.  For example:       <TextBox Text="{Binding ModelName, TargetNullValue='[No Model Name Set]' }"></TextBox> There might be cases , When Binding Properties to Target control ,binding throws exception or any binding operation failure , Fall back value provide a fall back value when binding is unable to return value <TextBox Text="{Binding ModelName, FallBackvalue='[No Model Name Set]' }"></TextBox>. String Format : Allows formatting of the bound value using standard formatting expressions.  <TextBlock x:Name="CurrencyExample" Text="{Binding Cost, StringFormat=C}"></TextBlock>  <TextBlock x:Name="BirthDateValueTextBlock" Text="{Binding BirthDate, StringFormat=MM/dd/yyyy}"></TextBlock>
Data Flow  Each Binding expression has Mode property which determines how and when the data flows.  There are 3 types of Data binding One Time Binding : Target property is set initially with the source data when the binding is created One way Binding : Update targets whenever source data changes. This is default Two Way Binding : The target property is updated when the source property changes, and the source Property is updated when the target property changes. UpdateSourceTrigger : Silverlight supports only two values for Update SourceTrigger: Default and Explicit. It isn’t possible to choose PropertyChanged ValidateonErrors and validate on exceptions
Thank you!

More Related Content

Similar to Data binding in silverlight

Silverlight 5 whats new overview
Silverlight 5 whats new overviewSilverlight 5 whats new overview
Silverlight 5 whats new overviewmdc11
 
Data Binding in Silverlight
Data Binding in SilverlightData Binding in Silverlight
Data Binding in SilverlightBoulos Dib
 
WPF & Silverlight UI
WPF & Silverlight UIWPF & Silverlight UI
WPF & Silverlight UIDave Allen
 
Flex3 data binding
Flex3 data bindingFlex3 data binding
Flex3 data bindingguestdf3003
 
Ui5con blr databinding
Ui5con blr databindingUi5con blr databinding
Ui5con blr databindingjatin dharani
 
Overview of entity framework by software outsourcing company india
Overview of entity framework by software outsourcing company indiaOverview of entity framework by software outsourcing company india
Overview of entity framework by software outsourcing company indiaJignesh Aakoliya
 
Entity framework and how to use it
Entity framework and how to use itEntity framework and how to use it
Entity framework and how to use itnspyre_net
 
TERMINALFOUR t44u 2009 - Data objects, Web object & External Sources
TERMINALFOUR t44u 2009 - Data objects, Web object & External SourcesTERMINALFOUR t44u 2009 - Data objects, Web object & External Sources
TERMINALFOUR t44u 2009 - Data objects, Web object & External SourcesTerminalfour
 
Angular 4 Data Binding | Two Way Data Binding in Angular 4 | Angular 4 Tutori...
Angular 4 Data Binding | Two Way Data Binding in Angular 4 | Angular 4 Tutori...Angular 4 Data Binding | Two Way Data Binding in Angular 4 | Angular 4 Tutori...
Angular 4 Data Binding | Two Way Data Binding in Angular 4 | Angular 4 Tutori...Edureka!
 
Flex data binding pitfalls: 10 common misuses and mistakes
Flex data binding pitfalls: 10 common misuses and mistakesFlex data binding pitfalls: 10 common misuses and mistakes
Flex data binding pitfalls: 10 common misuses and mistakesElad Elrom
 
Learning To Run - XPages for Lotus Notes Client Developers
Learning To Run - XPages for Lotus Notes Client DevelopersLearning To Run - XPages for Lotus Notes Client Developers
Learning To Run - XPages for Lotus Notes Client DevelopersKathy Brown
 
Polymer 3.0 by Michele Gallotti
Polymer 3.0 by Michele GallottiPolymer 3.0 by Michele Gallotti
Polymer 3.0 by Michele GallottiThinkOpen
 

Similar to Data binding in silverlight (20)

Silverlight 5 whats new overview
Silverlight 5 whats new overviewSilverlight 5 whats new overview
Silverlight 5 whats new overview
 
Simple Data Binding
Simple Data BindingSimple Data Binding
Simple Data Binding
 
Data Binding in Silverlight
Data Binding in SilverlightData Binding in Silverlight
Data Binding in Silverlight
 
WPF and Databases
WPF and DatabasesWPF and Databases
WPF and Databases
 
Silverlight Databinding
Silverlight DatabindingSilverlight Databinding
Silverlight Databinding
 
Spring and DWR
Spring and DWRSpring and DWR
Spring and DWR
 
WPF & Silverlight UI
WPF & Silverlight UIWPF & Silverlight UI
WPF & Silverlight UI
 
Flex3 data binding
Flex3 data bindingFlex3 data binding
Flex3 data binding
 
Ui5con blr databinding
Ui5con blr databindingUi5con blr databinding
Ui5con blr databinding
 
Overview of entity framework by software outsourcing company india
Overview of entity framework by software outsourcing company indiaOverview of entity framework by software outsourcing company india
Overview of entity framework by software outsourcing company india
 
สปริงเฟรมเวิร์ค4.1
สปริงเฟรมเวิร์ค4.1สปริงเฟรมเวิร์ค4.1
สปริงเฟรมเวิร์ค4.1
 
Entity framework and how to use it
Entity framework and how to use itEntity framework and how to use it
Entity framework and how to use it
 
TERMINALFOUR t44u 2009 - Data objects, Web object & External Sources
TERMINALFOUR t44u 2009 - Data objects, Web object & External SourcesTERMINALFOUR t44u 2009 - Data objects, Web object & External Sources
TERMINALFOUR t44u 2009 - Data objects, Web object & External Sources
 
Angular 4 Data Binding | Two Way Data Binding in Angular 4 | Angular 4 Tutori...
Angular 4 Data Binding | Two Way Data Binding in Angular 4 | Angular 4 Tutori...Angular 4 Data Binding | Two Way Data Binding in Angular 4 | Angular 4 Tutori...
Angular 4 Data Binding | Two Way Data Binding in Angular 4 | Angular 4 Tutori...
 
Flex data binding pitfalls: 10 common misuses and mistakes
Flex data binding pitfalls: 10 common misuses and mistakesFlex data binding pitfalls: 10 common misuses and mistakes
Flex data binding pitfalls: 10 common misuses and mistakes
 
exa_cer_g23
exa_cer_g23exa_cer_g23
exa_cer_g23
 
Learning To Run - XPages for Lotus Notes Client Developers
Learning To Run - XPages for Lotus Notes Client DevelopersLearning To Run - XPages for Lotus Notes Client Developers
Learning To Run - XPages for Lotus Notes Client Developers
 
Polymer 3.0 by Michele Gallotti
Polymer 3.0 by Michele GallottiPolymer 3.0 by Michele Gallotti
Polymer 3.0 by Michele Gallotti
 
J2EE pattern 5
J2EE pattern 5J2EE pattern 5
J2EE pattern 5
 
Php frameworks
Php frameworksPhp frameworks
Php frameworks
 

More from msarangam

Silverlight datatemplate
Silverlight datatemplateSilverlight datatemplate
Silverlight datatemplatemsarangam
 
Data binding in silverlight
Data binding in silverlightData binding in silverlight
Data binding in silverlightmsarangam
 
Silverlight control template
Silverlight control templateSilverlight control template
Silverlight control templatemsarangam
 
Silverlight converters
Silverlight convertersSilverlight converters
Silverlight convertersmsarangam
 
Silverlight command
Silverlight commandSilverlight command
Silverlight commandmsarangam
 
Silverlight as a desktop application
Silverlight as a desktop applicationSilverlight as a desktop application
Silverlight as a desktop applicationmsarangam
 
Routed events in silverlight
Routed events in silverlightRouted events in silverlight
Routed events in silverlightmsarangam
 
Ria services
Ria servicesRia services
Ria servicesmsarangam
 
Resources and styles
Resources and stylesResources and styles
Resources and stylesmsarangam
 
Printing in sl
Printing in slPrinting in sl
Printing in slmsarangam
 
Navigation application in silverlight
Navigation application in silverlightNavigation application in silverlight
Navigation application in silverlightmsarangam
 
Mvvm pattern
Mvvm patternMvvm pattern
Mvvm patternmsarangam
 
Introduction to silverlight
Introduction to silverlightIntroduction to silverlight
Introduction to silverlightmsarangam
 
Introduction to silverlight control 3
Introduction to silverlight control  3Introduction to silverlight control  3
Introduction to silverlight control 3msarangam
 
Introduction to silverlight control 4
Introduction to silverlight control 4Introduction to silverlight control 4
Introduction to silverlight control 4msarangam
 
Data validation in silverlight
Data validation in silverlightData validation in silverlight
Data validation in silverlightmsarangam
 
Background thread
Background threadBackground thread
Background threadmsarangam
 

More from msarangam (20)

File access
File accessFile access
File access
 
Silverlight datatemplate
Silverlight datatemplateSilverlight datatemplate
Silverlight datatemplate
 
Data binding in silverlight
Data binding in silverlightData binding in silverlight
Data binding in silverlight
 
Silverlight control template
Silverlight control templateSilverlight control template
Silverlight control template
 
Silverlight converters
Silverlight convertersSilverlight converters
Silverlight converters
 
Silverlight command
Silverlight commandSilverlight command
Silverlight command
 
Silverlight as a desktop application
Silverlight as a desktop applicationSilverlight as a desktop application
Silverlight as a desktop application
 
Routed events in silverlight
Routed events in silverlightRouted events in silverlight
Routed events in silverlight
 
Ria services
Ria servicesRia services
Ria services
 
Resources and styles
Resources and stylesResources and styles
Resources and styles
 
File access
File accessFile access
File access
 
Printing in sl
Printing in slPrinting in sl
Printing in sl
 
Navigation application in silverlight
Navigation application in silverlightNavigation application in silverlight
Navigation application in silverlight
 
Mvvm pattern
Mvvm patternMvvm pattern
Mvvm pattern
 
Introduction to silverlight
Introduction to silverlightIntroduction to silverlight
Introduction to silverlight
 
Introduction to silverlight control 3
Introduction to silverlight control  3Introduction to silverlight control  3
Introduction to silverlight control 3
 
Introduction to silverlight control 4
Introduction to silverlight control 4Introduction to silverlight control 4
Introduction to silverlight control 4
 
Html bridge
Html bridgeHtml bridge
Html bridge
 
Data validation in silverlight
Data validation in silverlightData validation in silverlight
Data validation in silverlight
 
Background thread
Background threadBackground thread
Background thread
 

Recently uploaded

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...apidays
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native ApplicationsWSO2
 
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.pptxRustici Software
 
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, ...apidays
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbuapidays
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsNanddeep Nachan
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyKhushali Kathiriya
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024The Digital Insurer
 
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 WoodJuan lago vázquez
 
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 challengesrafiqahmad00786416
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...apidays
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century educationjfdjdjcjdnsjd
 
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 FMESafe Software
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfOverkill Security
 
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
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processorsdebabhi2
 

Recently uploaded (20)

Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
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
 
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, ...
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu SubbuApidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
Apidays Singapore 2024 - Modernizing Securities Finance by Madhu Subbu
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024FWD Group - Insurer Innovation Award 2024
FWD Group - Insurer Innovation Award 2024
 
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
 
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
 
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
Apidays Singapore 2024 - Scalable LLM APIs for AI and Generative AI Applicati...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
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
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].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...
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 

Data binding in silverlight

  • 1. Data Binding in Silverlight Mahender Senior Software Engineer United Health Group
  • 2. Mahender Sarangam Having close to 5 years of experience. Working as a Senior Software Engineer in United Health Group. Good Knowledge on C#, ASP.NET, Silverlight, WPF ,SQL Server, Team Foundation Server(TFS) and SharePoint Technology. MCTS Certified in Web Technologies.
  • 3. Data Binding Data binding is a mechanism for moving the data from objects into UI controls. Data binding is a key in Silverlight that allows data shown on UI and then process changes. Data binding is a process that tells Silverlight to extract a property value from a source object and use it to set a property in a target object. Here Target Object which inherit from Dependency Object and its property must be a Dependency property. Data Binding works with Public properties of Source object. It does not work for fields.
  • 4. Data Binding We use Binding expression for binding Source property to Target property. Here we don’t mention source object which contain data. Generally in WPF/Silverlight, control uses Data context as Source Object or try to use source property of Binding expression. <UserControl.Resources> <local:Product x:Key="resourceProduct" ModelNumber="AEFS100" ModelName="Portable Defibrillator" UnitCost="77" Description="Analyzes the electrical activity of a person's heart and applies an electric shock if necessary."> </local:Product> </UserControl.Resources> <TextBox Text="{Binding ModelNumber, Source={StaticResourceresourceProduct} }“></TextBox>
  • 5. INotify Property Changed The INotifyPropertyChanged interface is a key part of the data binding infrastructure available in Silverlight. It contains a single event named PropertyChanged that is used to notify objects when a particular property value changes.
  • 6. Data Context Data Context: The Data Context refers to a source of data that can be bound to a target. The Data Context often is set to an instance of an entity Data Context is inherited to child elements and this makes it ideal for scenarios where you want to bind multiple elements to a single data source. Data Context is a property of Framework Element We use Binding expression for binding Source property to Target property
  • 7. Target Null Value and Fall Back values Target Null values are default values i.e. when bound data is NULL or there may be cases where value bounded is NULL. For example: <TextBox Text="{Binding ModelName, TargetNullValue='[No Model Name Set]' }"></TextBox> There might be cases , When Binding Properties to Target control ,binding throws exception or any binding operation failure , Fall back value provide a fall back value when binding is unable to return value <TextBox Text="{Binding ModelName, FallBackvalue='[No Model Name Set]' }"></TextBox>. String Format : Allows formatting of the bound value using standard formatting expressions. <TextBlock x:Name="CurrencyExample" Text="{Binding Cost, StringFormat=C}"></TextBlock> <TextBlock x:Name="BirthDateValueTextBlock" Text="{Binding BirthDate, StringFormat=MM/dd/yyyy}"></TextBlock>
  • 8. Data Flow Each Binding expression has Mode property which determines how and when the data flows. There are 3 types of Data binding One Time Binding : Target property is set initially with the source data when the binding is created One way Binding : Update targets whenever source data changes. This is default Two Way Binding : The target property is updated when the source property changes, and the source Property is updated when the target property changes. UpdateSourceTrigger : Silverlight supports only two values for Update SourceTrigger: Default and Explicit. It isn’t possible to choose PropertyChanged ValidateonErrors and validate on exceptions