在Windows Phone上,Tiles对ListBox的缩小效果

时间:2011-12-14 09:18:21

标签: silverlight windows-phone-7 listbox silverlight-toolkit itemtemplate

我已经创建了一个像这样的列表框

<ListBox Name="lstNews" SelectionChanged="lstNews_SelectionChanged">
                    <ListBox.ItemsPanel>
                        <ItemsPanelTemplate>
                            <toolkit:WrapPanel />
                        </ItemsPanelTemplate>
                    </ListBox.ItemsPanel>
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <Grid Margin="0,0,12,12"  Width="180" Height="180">
                                <Grid.Background>
                                    <ImageBrush>
                                        <ImageBrush.ImageSource>
                                            <BitmapImage CreateOptions="BackgroundCreation" UriSource="{Binding Picture}" />
                                        </ImageBrush.ImageSource>
                                    </ImageBrush>
                                </Grid.Background>
                                <StackPanel Background="#AA000000" VerticalAlignment="Bottom" Height="70" >
                                    <TextBlock Foreground="White" TextWrapping="Wrap" VerticalAlignment="Bottom" FontSize="16" Text="{Binding Title}" />
                                </StackPanel>
                            </Grid>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
</ListBox>

当用户点击某个项目时,我需要添加缩小效果。我见过很多应用程序都这样做,我不知道如何。

1 个答案:

答案 0 :(得分:3)

我假设您正在谈论倾斜效果,可以在wp7工具包中找到。

您可以通过执行此操作在全局级别设置

    <phone:PhoneApplicationPage xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit" 
           toolkit:TiltEffect.IsTiltEnabled="True">

有些好tutorials

相关问题