/ Published in: C#
A base class for very simple value converters in WPF, Windows Phone 7 and Silverlight.
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
using System.Windows.Data; public abstract class BaseValueConverter<TFrom> : IValueConverter { protected abstract object DoConversion(TFrom toConvert, object parameter); #region IValueConverter Members public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { return DependencyProperty.UnsetValue; return DoConversion((TFrom)value, parameter); } public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) { } #endregion }
URL: http://jacob4u2.blogspot.com