求WinUI3 C++中ListBox的ItemsSource实现示例
WinUI3 ListBox ItemsSource的C++实现示例请求
我找到了WinUI3 ListBox ItemsSource的C#实现示例,但未找到对应的C实现示例。以下是相关XAML代码和C#实现代码,请求提供对应的C实现代码:
XAML代码
<ListBox Width="200"> <x:String>Arial</x:String> <x:String>Comic Sans MS</x:String> <x:String>Courier New</x:String> </ListBox> <ListBox Width="200" ItemsSource="{x:Bind Fonts}" DisplayMemberPath="Item1" SelectedValuePath="Item2"/>
C#实现代码
private List<Tuple<string, FontFamily>> _fonts = new List<Tuple<string, FontFamily>>() { new Tuple<string, FontFamily>("Arial", new FontFamily("Arial")), new Tuple<string, FontFamily>("Comic Sans MS", new FontFamily("Comic Sans MS")), new Tuple<string, FontFamily>("Courier New", new FontFamily("Courier New")), new Tuple<string, FontFamily>("Segoe UI", new FontFamily("Segoe UI")), new Tuple<string, FontFamily>("Times New Roman", new FontFamily("Times New Roman")) }; public List<Tuple<string, FontFamily>> Fonts { get { return _fonts; } }
求对应的C++实现代码
?
内容的提问来源于stack exchange,提问作者krazy
相关产品推荐
相关产品推荐

