如何在Windows Phone 8中创建项目符号列表?

ero*_*las 4 xaml windows-phone-8

我只需要一个简单的项目列表,其中包含项目符号.我怎样才能做到这一点?我找不到任何控制这样做我可以使用网格等来实现这一点,但似乎这么简单的工作

McG*_*gle 15

只需将子弹字符直接插入XAML:

<StackPanel>
    <TextBlock Text="• Item 1"/>
    <TextBlock Text="• Item 2"/>
</StackPanel>
Run Code Online (Sandbox Code Playgroud)

您还可以使用Hex HTML实体:

<TextBlock>&#x2022; Item 1</TextBlock>
Run Code Online (Sandbox Code Playgroud)

如果项目来自viewmodel/binding,那么使用ItemsControl:

<ItemsControl ItemsSource="{Binding MyItems}">
    <ItemsControl.ItemTemplate>
        <DataTemplate>
            <TextBlock Text="{Binding StringFormat='• {0}'}" />
        </DataTemplate>
    </ItemsControl.ItemTemplate>
</ItemsControl>
Run Code Online (Sandbox Code Playgroud)

脚注:与Silverlight/Windows Phone无关,但WPF有BulletDecorator - 示例.