You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

求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

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.15 01:20:21