如何在Gridview中将Lives切片添加为数据模板,作为gridview项

时间:2015-11-05 06:02:53

标签: c# xaml

<Models:VariableSizedGridView x:Name="SalesGridview" ItemsSource="{Binding SalesData}" Padding="50,10,0,1000" SelectionChanged="On_selectionChanged" ItemContainerStyle="{StaticResource SalesGridviewitemcustomStyle}" HorizontalAlignment="Left" VerticalAlignment="Top" >
                            <Models:VariableSizedGridView.ItemTemplate>
                                <DataTemplate>
                                    <callisto:LiveTile>
                                        <callisto:LiveTile.ItemTemplate>
                                            <DataTemplate>
                                                    <Grid  VerticalAlignment="Stretch" HorizontalAlignment="Stretch">

                                            <Grid.Background>
                                                <SolidColorBrush Color="{Binding Background}"></SolidColorBrush>
                                            </Grid.Background>
                                            <Button Content="&#xe115;" FontFamily="Segoe UI Symbol" x:Name="flyoutcancel" Command="{Binding DeleteCommand}" Style="{StaticResource CustomSettingsButtonStyle}">
                                                <Button.Flyout>

                                                    <Flyout x:Name="EditFlyout" Models:FlyoutHelpers.IsOpen="{Binding IsFlyoutOpen, Mode=TwoWay}" Models:FlyoutHelpers.Parent="{Binding ElementName=flyoutcancel}" Placement="Bottom">

                                                        <Grid Background="Transparent" VerticalAlignment="Top" HorizontalAlignment="Left" >
                                                            <Grid.RowDefinitions>
                                                                <RowDefinition Height="Auto" ></RowDefinition>
                                                                <RowDefinition Height="*" ></RowDefinition>
                                                            </Grid.RowDefinitions>
                                                            <Button Content="&#xE10A;" Grid.Row="0" Foreground="White" Command="{Binding DataContext.CancelCommand, ElementName=SalesGridview}" CommandParameter="{Binding }" Style="{StaticResource CustomCancelPopupButtonStyle}" ></Button>
                                                            <StackPanel Width="165" Height="200" Grid.Row="1" Background="#334157">
                                                                <Button  HorizontalAlignment="Left" Height="Auto" Margin="10,10,0,10" Style="{StaticResource CustomCancelPopupButtonStyle}" >
                                                                    <Button.Content>
                                                                        <StackPanel Orientation="Horizontal" VerticalAlignment="Center" >
                                                                            <TextBlock Text="&#xE713;" FontSize="16" VerticalAlignment="Center" Style="{StaticResource SplitViewTextBlockStyle}"></TextBlock>
                                                                            <TextBlock Text="Widget Settings" Margin="10,3,0,0" FontSize="14" VerticalAlignment="Center" FontFamily="Segeo UI Semibold" Style="{StaticResource SplitViewTextBlockStyle}"></TextBlock>
                                                                        </StackPanel>
                                                                    </Button.Content>
                                                                </Button>
                                                                <Button HorizontalAlignment="Left" Margin="10,0,0,0" Height="Auto" Command="{Binding DataContext.DeleteCommand, ElementName=SalesGridview}" CommandParameter="{Binding Id}" Style="{StaticResource CustomCancelPopupButtonStyle}" >
                                                                    <Button.Content>
                                                                        <StackPanel Orientation="Horizontal" VerticalAlignment="Center" >
                                                                            <TextBlock Text="&#xE10A;" FontSize="16" VerticalAlignment="Center" Style="{StaticResource SplitViewTextBlockStyle}"></TextBlock>
                                                                            <TextBlock Text="Remove Widget" Margin="10,3,0,0" FontSize="14" VerticalAlignment="Center" FontFamily="Segeo UI Semibold" Style="{StaticResource SplitViewTextBlockStyle}"></TextBlock>
                                                                        </StackPanel>
                                                                    </Button.Content>
                                                                </Button>
                                                            </StackPanel>
                                                        </Grid>
                                                    </Flyout>
                                                </Button.Flyout>
                                            </Button>
                                        </Grid>
                                            </DataTemplate>
                                        </callisto:LiveTile.ItemTemplate>
                                    </callisto:LiveTile>
                                </DataTemplate>
                            </Models:VariableSizedGridView.ItemTemplate>
                            <Models:VariableSizedGridView.ItemsPanel>
                                <ItemsPanelTemplate>
                                    <VariableSizedWrapGrid VerticalAlignment="Center" Orientation="Horizontal"
                                       ItemHeight="90"
                                       ItemWidth="90">
                                        <VariableSizedWrapGrid.ChildrenTransitions>
                                            <TransitionCollection>
                                                <RepositionThemeTransition></RepositionThemeTransition>
                                                <ReorderThemeTransition></ReorderThemeTransition>
                                            </TransitionCollection>
                                        </VariableSizedWrapGrid.ChildrenTransitions>
                                    </VariableSizedWrapGrid>

                                </ItemsPanelTemplate>
                            </Models:VariableSizedGridView.ItemsPanel>
                        </Models:VariableSizedGridView>

我正在使用上面的代码为可变大小的gridview显示项目,在这些项目中,我想要显示为活动切片的一些项目。

如何绑定Gridview和Callisto Live切片项目的数据。 提前谢谢。

0 个答案:

没有答案