从ScatterViewItem中删除阴影不再起作用 [英] Removing shadow from ScatterViewItem isn't working anymore

查看:81
本文介绍了从ScatterViewItem中删除阴影不再起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我总是使用此代码从ScatterViewItem中删除阴影:
$


I always used this code to remove the shadow from a ScatterViewItem:


ScatterViewItem svi = new ScatterViewItem();
svi.ApplyTemplate();
svi.Background = new SolidColorBrush(Colors.Transparent);
svi.ShowsActivationEffects = false;
svi.BorderBrush = System.Windows.Media.Brushes.Transparent;
Microsoft.Surface.Presentation.Generic.SurfaceShadowChrome ssc;
ssc = svi.Template.FindName("shadow", svi) as Microsoft.Surface.Presentation.Generic.SurfaceShadowChrome;
ssc.Visibility = Visibility.Hidden;

推荐答案

您要在此处执行的操作是重新模板化ScatterViewItem控件以查看您的需求。使用Expression Blend执行此操作的最简单方法。

What you want to do here is re-template the ScatterViewItem control to look how you want. The easiest way to do this with Expression Blend.

在Blend中,右键单击ScatterView并选择"编辑其他模板",然后选择"ItemContainerStyle",然后选择"编辑副本"。 ;。这将根据默认样式为ScatterView中的所有ScatterViewItem创建一个新模板,并将其应用于
ScatterView。

In Blend, right-click your ScatterView and choose "Edit Additional Templates", then "ItemContainerStyle", then "Edit a copy". This will create a new template for all of the ScatterViewItems in that ScatterView based on the default style, and apply it to your ScatterView.

从那里你应该看到一个"阴影"模板中的元素。只是删除它,你永远不会再看到它。从那里你可以进行其他更改,使SVI看起来完全符合您的喜好。

From there you should see a "shadow" element in the template. Just delete it and you'll never see it again. From there you can make additional changes to make the SVI look exactly as you like it.

(另外我建议将ShowsActivationEffects保留,以保持项目时出现的"光泽"被激活,除非它真的不适合您的使用。)

(Also I'd recommend leaving ShowsActivationEffects on to keep the "sheen" which appears when an item is activated, unless it's really not appropriate for your use.)


这篇关于从ScatterViewItem中删除阴影不再起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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