1

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,

Yuval
  • 11
  • 1

2 Answers2

2
svi.Background = null;

svi.BorderThickness = new Thickness(0);

svi.ShowsActivationEffects = false;

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

ssc.Visibility = Visibility.Collapsed;
Laur Ivan
  • 4,117
  • 3
  • 38
  • 62
Robert Levy
  • 28,747
  • 6
  • 62
  • 94
0
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;
Laur Ivan
  • 4,117
  • 3
  • 38
  • 62
  • Welcome to Stack Overflow! While this answer is probably correct and useful, it is preferred if you [include some explanation along with it](http://meta.stackexchange.com/q/114762/159034) to explain how it helps to solve the problem. This becomes especially useful in the future, if there is a change (possibly unrelated) that causes it to stop working and users need to understand how it once worked. Thanks! – Hatchet Mar 14 '16 at 17:01