我有一個委託類型:如何在Xaml中使用委託類型屬性?
public delegate bool CheckFormatDelegate(int row, int col, ref string text);
這已經在一個屬性被用於在XAML對象上:
public virtual CheckFormatDelegate CheckFormat { get; set; }
我的屬性值設置爲一組的代表,例如中的一個:
public class FCS
{
public static bool FormatDigitsOnly(int row, int col, ref string text)
{
...
}
}
如果我在codebehind中設置屬性,一切都很好。但是,如果我將它設置在XAML:
<mui:DXCell CheckFormat="mui:FCS.FormatDigitsOnly"/>
當我運行我的應用程序我得到一個異常:「‘CheckFormatDelegate’類型不具有公共的TypeConverter類。」有沒有人知道是否有一組內置的轉換器/標記擴展,如用於RoutedEvent的擴展?或者還有其他解決方法嗎?
可能重複(http://stackoverflow.com/questions/5146946/binding-of-static-methode-function-to-funct-property-in-xaml) – 2011-06-09 07:17:26
看起來這個解決方案實際上適用於我。如果你可以把它放在你的答案中,我會接受它。謝謝! – 2011-06-09 07:37:24