locked
Shadows not appearing under drop down MenuItem parts RRS feed

  • Question

  • I have inserted a menu into my program and edited the template of the MenuItem parts, adding an effect of a drop shadow behind each portion of the drop down menu.  The shadows appear well enough when editing the template, but when I run the program, the shadows do not appear.  I see a slight amount of black at the rounded corners seeming to indicate the shadow is indeed there, but perhaps being clipped. I checked all of my elements, and do not see any clipping enabled--I'm totally lost as to why the shadows do not appear.

    Here is an image to demonstrate the issue:

    Click here to see example image

    Purkiss
    Thursday, November 20, 2008 3:41 PM

All replies

  • Hi,

    In Objects and Timeline Section

    Select each menuitem and then right click on it
    in the Popup Context Menu Select "Edit Control Parts(Templete)" -> Apply Resource -> Resource Name (Templete Name What you have created)

    Saturday, November 29, 2008 5:20 PM
  • Yes, the resource is correctly applied.  In fact, when i edit the template, i see the shadow. I even see the shadow in the final build (see the jpg in the first post)...but it is clipped for some reason.  I even checked for 'allow transparency' on the Shdw control in the template...it's checked.  I still haven't figured out what is clipping it.
    Purkiss
    Monday, December 8, 2008 11:49 PM
  • try adding BitmapEffect see below example...

        <Menu x:Name="MainMenu">  
                <Menu.BitmapEffect> 
                <DropShadowBitmapEffect /> 
            </Menu.BitmapEffect> 
            <MenuItem Header="_Edit" x:Name="EditMenu">  
          <MenuItem Header="Cu_t"   Command="ApplicationCommands.Cut" /> 
          <MenuItem Header="_Copy"  Command="ApplicationCommands.Copy" /> 
          <MenuItem Header="_Paste" Command="ApplicationCommands.Paste" /> 
        </MenuItem>   
        </Menu> 
     

    Prasad - www.beautifulmind.blog.co.in
    • Proposed as answer by prasad22 Wednesday, December 17, 2008 5:43 PM
    • Unproposed as answer by Purkiss Tuesday, December 23, 2008 2:23 PM
    Wednesday, December 17, 2008 5:43 PM
  • Hi Prasad,

    Thank you again for your offering of help.

    Before finding the native shadow feature built into the menu option, I had originally tried applying a bitmap drop shadow effect.  The same issue remains:  when editing the menu template, the shadow appears fine, but when using my application, the shadows are clipped within a few pixels of the drop down.  For now, I've left it as is, and still haven't found a solution.  Clip-to-bounds is not enabled on any element, so I've no idea what is causing the cut off on every menu drop down shadow.
    Purkiss
    Tuesday, December 23, 2008 2:23 PM