网格视图项目展示器
Grid View Item Presenter
如何指定 Grid View Item Presenter?
(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>
这个怎么样
<GridView.ItemContainerStyle>
<Style TargetType="GridViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
</Style>
</GridView.ItemContainerStyle>
如何指定 Grid View Item Presenter?
(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>
这个怎么样
<GridView.ItemContainerStyle>
<Style TargetType="GridViewItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
</Style>
</GridView.ItemContainerStyle>