As part of the WPF training, I just finished working with MS Lab Exercise called "Using Data Binding in WPF" ( http://windowsclient.net/downloads/folders/hands-on-labs/entry3729.aspx ).
To illustrate the use of IMultiValueConverter, there is a pre-encoded implementation of the one where the logical result is used to determine whether data binding is relevant for the current user. Here is the code for the conversion operation:
public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture) {
var rating = (int)(values[0]);
var date = (DateTime)(values[1]);
return _hasGoodRating(rating) && _isLongTimeMember(date);
}
And here is the gasket for use in XAML:
<ComboBox.IsEnabled>
<MultiBinding Converter="{StaticResource specialFeaturesConverter}">
<Binding Path="CurrentUser.Rating" Source="{x:Static Application.Current}"/>
<Binding Path="CurrentUser.MemberSince" Source="{x:Static Application.Current}"/>
</MultiBinding>
</ComboBox.IsEnabled>
, XAML " ". . , . - , MS, .
- , , ?
Cheers,
Berryl