如何指定网格视图项目演示者?
(ScreenShot)我想我可以改变GridViewItemsPresenter的HorizantalContentAlignment。
<GridView.ItemTemplate>
<DataTemplate x:DataType="local:mymodel">
<StackPanel BorderThickness="4,0,0,0" BorderBrush="{x:Bind Color}"Padding="4,0,0,0" Margin="0,2" HorizontalAlignment="Left">
<TextBlock Text="{x:Bind Name}" Style="{ThemeResource BodyTextBlockStyle}" HorizontalAlignment="Left"/>
<TextBlock Text="{x:Bind Date}" Style="{ThemeResource BodyTextBlockStyle}"/>
<TextBlock Text="{x:Bind Type}" Style="{ThemeResource BodyTextBlockStyle}"/>
<TextBlock Text="{x:Bind Dls}" Style="{ThemeResource BodyTextBlockStyle}"/>
</StackPanel>
</DataTemplate>
</GridView.ItemTemplate>
答案 0 :(得分:2)
这个怎么样
<GridView.ItemContainerStyle>
<Style TargetType="GridViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
</Style>
</GridView.ItemContainerStyle>