Search code examples
wpfxamlstylesshadowpixelsense

How to remove the shadow from a librarystack


I'm currently in a project where I need a LibraryStack with no visuals at all, so it would just show the content. If I just remove the background a shadow stays in view which I cant seem to remove...

librarystack with no background http://img97.imageshack.us/img97/6778/librarystack.jpg

This code looks like:

<s:LibraryStack Background="Transparent">
    <s:LibraryStackItem Background="AliceBlue"/>
    <s:LibraryStackItem Background="Bisque"/>
    <s:LibraryStackItem Background="Salmon"/>
</s:LibraryStack>

This stack is just for explaining purposes, the actual stack is added in the code behind in c#. So preferably any answers that would be usefull to add in c#.


Solution

  • You'll need to re-template the control. For example:

    <s:LibraryStack>
      <s:LibraryStack.Template>
        <ControlTemplate TargetType="{x:Type s:LibraryStack}">
          <Grid>
            <ItemsPresenter/>
          </Grid>
        </ControlTemplate>
      </s:LibraryStack.Template>
      <s:LibraryStackItem Background="AliceBlue"/>
      <s:LibraryStackItem Background="Bisque"/>
      <s:LibraryStackItem Background="Salmon"/>
    </s:LibraryStack>