Lambda in XAML

Here are links to a 3 part series with code that let you use C#-like lambda expressions in XAML instead of writing value converters.

For example, instead of writing a value converter that takes a DateTime and calls ToShortTimeString you can write:

<TextBlock Text='{Binding Source={x:Static s:DateTime.Now},
                 Converter={fix:Lambda "dt=>dt.ToShortTimeString()"}}'>
  1. WPFix Part 1 (Lambda Converter Extension)
  2. WPFix Part 2 (Binding Extension)
  3. WPFix Part 3 (Extension Methods)

posted @ Thursday, November 6, 2008 4:14 PM

Comments on this entry:

No comments posted yet.

Your comment:



 (will not be displayed)


 
 
Please add 6 and 4 and type the answer here: