Windows 应用商店应用程序:消除 GridView 样式并仅用于中心页面布局 [英] Windows Store App: Eliminates GridView styles and use only for hub page layout
问题描述
我尝试使用 GridView 制作一个 Windows 应用商店应用 (Metro) 中心页面,其中包含四个不同的模板.
I try to make a Windows Store App (Metro) hub page which has four different templates with GridView.
我引用了链接 在 在 Windows 8 中创建具有不同控件的中心页面 页面,它工作正常.
I referenced link in Creating hub page with different controls in Windows 8 page and it works fine.
但是 GridView 有一个默认样式,它与触摸(和鼠标)活动交互.悬停时显示为灰色,并显示点击交互.
But GridView has a default style which interacts with touch(and mouse) activity. It grayed when hover, and shows click interaction.
我的问题是,如何禁用这些行为?我尝试使用 Blend 进行挖掘,但很难找到要定制的位置.
My question is, how to disable those behaviors? I tried to dig with Blend but hard to find the place to be customized.
推荐答案
抱歉我不知道 MS Blend
Sorry I don't know MS Blend
但在 Visual Studio 中请按照以下说明进行操作:
But in visual studio please follow below instruction :
- 右键单击您的网格
- 转到编辑附加模板
- 点击编辑生成的项目容器(ItemContainerStyle)">编辑副本..."
转到 XAML 代码并从代码中删除 PointerOver 内容.代码应如下所示
- right click on your grid
- go to Edit Additional Template
- click on 'Edit Generated Item Container(ItemContainerStyle)' > 'Edit a Copy...'
go to XAML code and remove the PointerOver content from your code. the code should be like the following
//some code here
<VisualStateGroup x:Name="CommonStates">
<VisualState x:Name="Normal"/>
<VisualState x:Name="PointerOverPressed"/>
<VisualState x:Name="Disabled">
//continue
这篇关于Windows 应用商店应用程序:消除 GridView 样式并仅用于中心页面布局的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!