使用XAML,我試圖獲得一個列表框來顯示系統字體列表。WPF數據綁定 - 顯示系統字體列表
我不確定在Bindings字符串中輸入什麼內容。
這裏是我的嘗試:
<Window x:Class="ListDataBinding.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:m="clr-namespace:System.Windows.Media;assembly=PresentationCore"
Title="Window1" Height="300" Width="300">
<Grid>
<ListBox ItemsSource="{Binding Source={StaticResource m:Fonts.SystemFontFamilies}}"></ListBox>
</Grid>
</Window>
我得到一個錯誤:無法找到指定的資源 '{M:Fonts.SystemFontFamilies}'
我不知道我應該打字。我還沒有設法找到一個有用的MSDN頁面 - 如果有人可以指向我的鏈接,我會很感激。
您是如何知道get_SystemFontFamilies方法的? – Frinavale 2014-08-21 20:48:50