2011-11-14 37 views

回答

1

我認爲在這種情況下,你必須使用一個Value Converter

例如

public class MaxCountConverter : IValueConverter 
{ 
    public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 
    { 
     return (int)value - 1; 
    } 

    public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) 
    { 
     throw new NotImplementedException(); 
    } 
} 

你可能會需要做的錯誤處理和東西,這只是給你一個起點。