windows-phone-7 – 如何做这样的事情? (应用程序内的瓷砖)Windows手机
|
对不起,如果问题标题不清楚,但我正在尝试这样做,我不知道如果他们是一个WrapControl中的瓷砖或图像: 我正在考虑用封装面板做这样的事情,每一个块都是堆叠面板。但我不知道这是否是正确的方法。 有没有办法做这样的事情? 你在正确的轨道上。 WrapPanel是要走的路:)为了使每个块更有趣,您可以从最新的windows phone toolkit中查看HubTile控件。无论使用哪个控件/面板,只需记住大小应为173 * 173。 使用ListBox 在我的一个项目中,我创建了一个ListBox来完成所有这些。我使用ListBox的原因是因为ListBox有一个SelectedItem属性,它告诉我哪个tile被用户点击。另外一个原因是ListBoxItems可以收到很好的倾斜效果。 Baiscally你只需要创建一个像瓷砖的ListBoxItem样式并将其应用于ListBox的ItemContainerStyle,还需要将ListBox的ItemsPanel设置为WrapPanel。 怎么样 ListBoxItem样式 <Style x:Key="TileListBoxItemStyle" TargetType="ListBoxItem">
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="VerticalContentAlignment" Value="Stretch"/>
<Setter Property="Padding" Value="0"/>
<Setter Property="FontSize" Value="64"/>
<Setter Property="Margin" Value="12,12,0"/>
<Setter Property="Background" Value="{StaticResource PhoneAccentBrush}"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Width" Value="173"/>
<Setter Property="Height" Value="173"/>
<Setter Property="HorizontalAlignment" Value="Left"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ListBoxItem">
<Grid>
<Rectangle Fill="{TemplateBinding Background}"/>
<ContentPresenter HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
列表框 <!-- set its ItemContainerStyle which is the style for each ListBoxItem -->
<ListBox ItemContainerStyle="{StaticResource TileListBoxItemStyle}">
<!-- set its ItemsPanel to be a WrapPanel -->
<ListBox.ItemsPanel>
<ItemsPanelTemplate>
<toolkit:WrapPanel />
</ItemsPanelTemplate>
</ListBox.ItemsPanel>
<ListBoxItem>
<Grid>
<TextBlock Text="Messages" />
<StackPanel Orientation="Horizontal" HorizontalAlignment="Center" VerticalAlignment="Center">
<Path Data="M1.4901163E-05,9.8579922 L50.000015,46.316994 L100.00002,9.8579922 L100.00002,62.499992 L1.4901163E-05,62.499992 z M0,0 L100,0 L50,36.458 z" Fill="White" Height="38.125" Stretch="Fill" UseLayoutRounding="False" Width="61" d:IsLocked="True" />
<TextBlock Text="12" Margin="4,8" />
</StackPanel>
</Grid>
</ListBoxItem>
<ListBoxItem/>
<ListBoxItem/>
<ListBoxItem/>
<toolkit:HubTile Title="Me " Message="..." Notification="new messages!" Source="xxx.jpg" Margin="12,0" />
</ListBox>
你可以看到最后一个项目其实是一个HubTile。 希望有帮助! (编辑:安卓应用网) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
- windows – C try-catch块没有捕获硬件异常
- windows自带应用xbox无法登陆:0x80070426:服务尚未启动
- Windows 下安装 Node.js
- Windows Phone 7 – Windows Phone的单元测试状态
- windows – 如何以编程方式启用/禁用网络连接选项
- ui-automation – Microsoft UI Automation:调用模式异常
- 为Windows创建R pacakge -ERROR:包xxx的编译失败
- Windows Server 2008 R2和2012中PHP连接MySQL过慢的解决方法
- glib:windows下基于MSYS2环境编译glib2的过程
- Win2008 r2 IIS7.5制定目录禁止执行脚本的方法
- 我在哪里报告Windows核心库问题?
- win10 spark+scala+eclipse+sbt 安装配置
- windows – 以MONO Runtime为目标导致Xamarin Bu
- webbrowser-control – Windows Phone 7 WebBrow
- 在windows上编译32位和64位mono
- windows-7 – 在windows7中设置JRE路径的要求,如
- windows – 为什么模拟会话中定义的DOS设备不会出
- 在Windows上连接到GitHub时出现问题,甚至是通过P
- POJ2823 Sliding Window(单调队列,线段树,set,
- Windows下安装Memcached的步骤说明
