【发布时间】:2014-01-29 23:53:17
【问题描述】:
这个问题是关于列表框本身而不是单元格。如果我将列表框放入视图框中,然后单击一个项目,则整个列表框将被 1px 边框包围。我不想要那个,因为它很丑。这个边框怎么去掉?
详情:
<Grid Background="{ThemeResource ApplicationPageBackgroundThemeBrush}">
<Viewbox Grid.Row="1" Stretch="Uniform">
<StackPanel Orientation="Horizontal" Margin="0,20,0,20">
<Grid Width="200">
<ListBox ItemsSource="{Binding Rajzelemek}" Background="{x:Null}">
<ListBox.ItemTemplate>
<DataTemplate>
<StackPanel Orientation="Horizontal">
<ContentControl Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" Content="{Binding Ikonja}" Width="25" Height="25" VerticalAlignment="Center" />
<TextBlock Text="{Binding}" VerticalAlignment="Center" Foreground="{ThemeResource ApplicationForegroundThemeBrush}" />
</StackPanel>
</DataTemplate>
</ListBox.ItemTemplate>
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<StackPanel Orientation="Vertical" Background="{ThemeResource ApplicationPageBackgroundThemeBrush}" />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
</ListBox>
</Grid>
</StackPanel>
</Viewbox>
</Grid>
如果我评论 <Viewbox Grid.Row.... 部分,一切都很好,但没有缩放。我想要缩放东西,这就是我使用视图框的原因,但我不想要这个边框:
上面的代码也被放在了一个地铁 BlankPage1 上,并且做了同样的事情。
【问题讨论】:
标签: xaml listbox microsoft-metro