我在C#開發Windows 8應用程序,並使用數據綁定綁定屬性,方法
<CollectionViewSource
x:Name="departments"
Source="{Binding Departments}"
d:Source="{Binding AllGroups, Source={d:DesignInstance Type=data:Department, IsDesignTimeCreatable=True}}"/>
我這個類的屬性綁定到我的UI,但是類也有這個方法,我需要
public String getProfessorsList()
我希望能夠結合這樣的方法......
<TextBlock Text="{Binding getHeads()}" FontSize="18" />
...但顯然這不是允許。我怎樣才能實現這個功能?
綁定到他們的getter返回方法調用自動實現的屬性。 – tnw 2013-05-09 17:25:22