WrapGrid使TextBlocks有效消失。显示项目的轮廓,但无法看到文本。在运行期间,项目正确显示。
如何在设计时出现它们?
<ListView HorizontalAlignment="Left">
<ListView.ItemsPanel>
<ItemsPanelTemplate>
<WrapGrid Orientation="Horizontal" MaximumRowsOrColumns="3"></WrapGrid>
</ItemsPanelTemplate>
</ListView.ItemsPanel>
<ListView.Items>
<TextBlock>LOREM IPSUM</TextBlock>
<TextBlock>LOREM IPSUM</TextBlock>
<TextBlock>LOREM IPSUM</TextBlock>
<TextBlock>LOREM IPSUM</TextBlock>
<TextBlock>LOREM IPSUM</TextBlock>
<TextBlock>LOREM IPSUM</TextBlock>
<TextBlock>LOREM IPSUM</TextBlock>
<TextBlock>LOREM IPSUM</TextBlock>
<TextBlock>LOREM IPSUM</TextBlock>
<TextBlock>LOREM IPSUM</TextBlock>
<TextBlock>LOREM IPSUM</TextBlock>
<TextBlock>LOREM IPSUM</TextBlock>
</ListView.Items>
</ListView>
答案 0 :(得分:1)
我在这里找到答案:The content of a ListView with ItemsPanel modified is not shown in designer (VS and Blend)。
基本上它是一个已知的bug,他们建议使用ItemsWrapGrid而不是WrapGrid。