Yuval
Yuval

Reputation: 11

Remove shadow from a ScatterViewItem in C# (not XAML)

I am developing an application on Microsoft Surface. I add programmatically many PNG images as ScatterViewItems. Even though I set the item to be transparent, it shows a shadow.

How do I remove the shadow in C#? (not in XAML).

Thank you in advance,

Upvotes: 1

Views: 896

Answers (2)

beidou566
beidou566

Reputation: 1

using dll Microsoft.Surface.Presentation.Generic

svi.ApplyTemplate(); //must
svi.ShowsActivationEffects = false;

Microsoft.Surface.Presentation.Generic.SurfaceShadowChrome ssc 
                    = svi.Template.FindName("shadow", svi) as 
                      Microsoft.Surface.Presentation.Generic.SurfaceShadowChrome;

if(ssc!=null)
    ssc.Visibility = Visibility.Collapsed;

Upvotes: 0

Robert Levy
Robert Levy

Reputation: 29083

svi.Background = null;

svi.BorderThickness = new Thickness(0);

svi.ShowsActivationEffects = false;

SurfaceShadowChrome ssc = svi.Template.FindName("shadow", svi) as SurfaceShadowChrome;

ssc.Visibility = Visibility.Collapsed;

Upvotes: 2

Related Questions