<Label Content="{Binding ActivityName}" Foreground="Black"></Label>
<Label Content="{Binding ActivityType}" Foreground="Black"></Label>
標籤時我的Activity
的列表綁定到該DataTemplate
,我可以看到ActivityName
(一String
屬性)顯示在Label
罰款。然而,ActivityType
是enum
,並且這完全不綁定到Label
。我假設我需要在枚舉上調用某種toString()
,但我不知道如何在XAML中執行此操作。綁定枚舉值數據模板
謝謝。
檢查這個問題:http://stackoverflow.com/questions/3695976/wpf-binding-enum-type-to-textbox – dg90
謝謝,看起來可能是答案。儘管如此簡單但很多工作。 –
是的,的確我同意!幾個月前有同樣的問題gl ;-) – dg90