Windows Phone 上 ListBox 上的 Tiles 缩小效果

发布于 2024-12-20 22:32:02 字数 1584 浏览 1 评论 0原文

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

<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>

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

I've created a listbox like this

<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>

I need to add a shrinking effect when the user taps on an item. I've seen a lot of apps do that, I dunno how.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

别再吹冷风 2024-12-27 22:32:02

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

您可以通过这样做在全局级别设置它,

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

一些好的 教程

I assume you are talking about the tilt effect, which can be found in the wp7 toolkit.

You can set it at the global level by doing this,

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

Some good tutorials.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文