Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Arrow up icon
GO TO TOP
Mastering LOB Development for Silverlight 5: A Case Study in Action

You're reading from   Mastering LOB Development for Silverlight 5: A Case Study in Action Develop a full LOB Silverlight 5 application from scratch with the help of expert advice and an accompanying case study with this book and ebook

Arrow left icon
Product type Paperback
Published in Feb 2012
Publisher Packt
ISBN-13 9781849683548
Length 430 pages
Edition 1st Edition
Languages
Arrow right icon
Toc

Table of Contents (19) Chapters Close

Mastering LOB Development for Silverlight 5: A Case Study in Action
Credits
Foreword
About the Authors
About the Reviewers
www.PacktPub.com
Preface
1. Express Introduction to Silverlight FREE CHAPTER 2. Forms and Browsing 3. Data Binding 4. Architecture 5. RIA Services Data Access 6. Out of Browser (OOB) Applications 7. Testing your LOB Application 8. Error Control 9. Integration with other Web Applications 10. Consuming Web Services 11. Security Index

Converters


Most of the time, when data is shown to the user, there are aspects or values, which are not clear or intuitive enough for them. A way to solve this problem is by changing the format or making a conversion before binding. To do so, Silverlight offers an interface which allows us to perform this action.

Note

If you need to make simple formatting (for example, displaying a Date or Time), StringFormat can be directly used on the XAML (this was introduced in Silverlight 4). For more information, please visit http://bit.ly/jMBtDp.

IValueConverter

When this interface is implemented, we obtain the following functions:

  • Convert: This function prepares the data, obtained from the DataSource, to display it in the view.

  • ConvertBack: This one is in charge of making the opposite change, it gets the data ready from the view to store in the source.

We will generate an instance to convert the numerical value provided by a property, to an image. The final result will appear similar to the following...

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime