在Metro风格gridview中将wpf gridview实现为相同

时间:2013-01-21 07:00:45

标签: wpf gridview wpf-controls microsoft-metro wpfdatagrid

对于我的WPF应用程序,我试图在WPF中获得Windows 8 metro Gridview样式。这是我的Metro风格Gridview设计的示例代码:

<DataTemplate x:Key="DashboardItemTemplate">
    <Grid HorizontalAlignment="Left" Width="600" Height="120">
        <Border BorderThickness="0" Background="#4B0F03">
            <Image Source="{Binding Image}" Stretch="UniformToFill" AutomationProperties.Name="{Binding Title}"/>
        </Border>
        <StackPanel VerticalAlignment="Bottom" Background="#000000">
            <TextBlock Text="{Binding Title}" Foreground="{StaticResource ListViewItemOverlayForegroundThemeBrush}" Style="{StaticResource TitleTextStyle}"     Height="70" Margin="15,0,15,0"/>
            <TextBlock Text="" Foreground="{StaticResource ListViewItemOverlaySecondaryForegroundThemeBrush}" Style="{StaticResource CaptionTextStyle}" TextWrapping="NoWrap" Margin="15,0,15,10"/>
        </StackPanel>
    </Grid>
</DataTemplate>

<GridView
        x:Name="itemGridView"
        AutomationProperties.AutomationId="ItemsGridView"
        AutomationProperties.Name="Items"
        TabIndex="1"
        Grid.RowSpan="2"
        Padding="116,136,116,46"
        ItemsSource="{Binding Source={StaticResource itemsViewSource}}"
        ItemTemplate="{StaticResource DashboardItemTemplate}"
        SelectionMode="None"
        IsSwipeEnabled="false"
        IsItemClickEnabled="True"
        ItemClick="ItemView_ItemClick"/>

但是我没有在WPF Gridview中获得绑定DataTemplate的任何选项,是否有任何选项可以在WPF应用程序中将Gridview与DataTemplate绑定?或任何其他方式获得WPF Gridview,如Windows 8 Gridview样式。

0 个答案:

没有答案