Windows 应用商店应用程序:消除 GridView 样式并仅用于中心页面布局 [英] Windows Store App: Eliminates GridView styles and use only for hub page layout

查看:44
本文介绍了Windows 应用商店应用程序:消除 GridView 样式并仅用于中心页面布局的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我尝试使用 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 :

  1. 右键单击您的网格
  2. 转到编辑附加模板
  3. 点击编辑生成的项目容器(ItemContainerStyle)">编辑副本..."
  4. 转到 XAML 代码并从代码中删除 PointerOver 内容.代码应如下所示

  1. right click on your grid
  2. go to Edit Additional Template
  3. click on 'Edit Generated Item Container(ItemContainerStyle)' > 'Edit a Copy...'
  4. 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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆