2
如何在自動調整爲false時禁用以下轉換器。我應該輸入什麼代碼什麼也不做區域。如何在某些情況下禁用轉換器
[ValueConversion(typeof(Boolean), typeof(Double))]
public class ConvertAutoSize2HeightWidth : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{
Boolean autosize = (Boolean)value;
if (autosize)
return Double.NaN;
else
//**do nothing**
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{
throw new NotImplementedException();
}
}
Binding.DoNothing;確實有效。謝謝 – dongx 2013-02-21 16:59:44