开发者

Disable Shadow on a ScatterViewItem on Microsoft Surface

开发者 https://www.devze.com 2022-12-18 13:41 出处:网络
I\'m developing a program on Microsoft Surface. And I didn\'t succeed to ma开发者_运维技巧ke disable completely the shadow.

I'm developing a program on Microsoft Surface.

And I didn't succeed to ma开发者_运维技巧ke disable completely the shadow. Here is my problem :

http://i61.servimg.com/u/f61/11/31/25/01/sans_t10.png

Heres is the XAML code :

    <s:ScatterViewItem Height="130" x:Name="jetons1" Width="180" CanScale="False" 
       BorderThickness="0" ShowsActivationEffects="False" StaysActive="True" 
       SnapsToDevicePixels="True" Foreground="{x:Null}" Background="{x:Null}" 
       BorderBrush="{x:Null}" />


Assuming that item is your ScatterViewItem:

item.ApplyTemplate();
item.Background = new SolidColorBrush(Colors.Transparent);
item.ShowsActivationEffects = false;
Microsoft.Surface.Presentation.Generic.SurfaceShadowChrome ssc;
ssc = item.Template.FindName("shadow", item) as Microsoft.Surface.Presentation.Generic.SurfaceShadowChrome;
ssc.Visibility = Visibility.Hidden;


You can do it. Use Expression Blend to extract template and remove the control named x:name="Shadow". You could do this as well in code-behind. As a Microsoft Surface developer you have access to the community (I think now it's free for all), both solutions were posted.

0

精彩评论

暂无评论...
验证码 换一张
取 消