This is a migrated thread and some comments may be shown as answers.

DropShadowEffect

2 Answers 149 Views
ContextMenu
This is a migrated thread and some comments may be shown as answers.
Steve
Top achievements
Rank 1
Steve asked on 13 Jun 2012, 10:58 PM
I can create RadContextMenu with a DropShadowEffect if I just show it in a Grid; however if I try and attach it to a Window.ContextMenu (or any other control) the shadow doesn't appear.  I've tried all sorts of variations using Resource Styles and ResourceDictionaries, and nothing works.  I'm including the MainWindow.xaml source and a screen shot showing the results.

<Window
    x:Class="WpfApplication2.MainWindow"
    x:Name="Window"
    Title="MainWindow"
    Width="640" Height="480"
    >
    <telerik:RadContextMenu.ContextMenu>
        <telerik:RadContextMenu ClickToOpen="True"
                                InheritDataContext="False">
            <telerik:RadContextMenu.Effect>
                <DropShadowEffect ShadowDepth="3" Opacity="0.445" RenderingBias="Quality"/>
            </telerik:RadContextMenu.Effect>
                <telerik:RadMenuItem Header="Copy" />
                <telerik:RadMenuItem Header="Paste" />
                <telerik:RadMenuItem Header="Cut" />
                <telerik:RadMenuItem IsSeparator="True" />
                <telerik:RadMenuItem Header="Select All" />
            </telerik:RadContextMenu>
    </telerik:RadContextMenu.ContextMenu>
 
    <Grid x:Name="LayoutRoot">
        <telerik:RadContextMenu
            Margin="105,53,247,147"
            ClickToOpen="True"
            InheritDataContext="False">
            <telerik:RadContextMenu.Effect>
                <DropShadowEffect ShadowDepth="3" Opacity="0.445" RenderingBias="Quality"/>
            </telerik:RadContextMenu.Effect>
            <telerik:RadMenuItem Header="Item 1">
                <telerik:RadMenuItem Header="Sub Item 1"/>
                <telerik:RadMenuItem Header="Sub Item 2"/>
            </telerik:RadMenuItem>
            <telerik:RadMenuItem Header="Item 2">
                <telerik:RadMenuItem Header="Sub Item 3"/>
                <telerik:RadMenuItem Header="Sub Item 4"/>
                <telerik:RadMenuItem Header="Sub Item 5"/>
            </telerik:RadMenuItem>
        </telerik:RadContextMenu>
    </Grid>
</Window>



What am I doing wrong?

Thanks in advance,
Steve



2 Answers, 1 is accepted

Sort by
0
Accepted
Dani
Telerik team
answered on 18 Jun 2012, 01:00 PM
Hi Steve,

You can give the RadContextMenu a little Margin of about 10px to allow it to pop up from the back and have the room to display its DropShadowEffect.

Alternatively, if you need to apply the same for the second-level popup, you will need to edit the template of the RadMenuItem.

I hope this will help.

All the best,
Dani
the Telerik team
Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>
0
Steve
Top achievements
Rank 1
answered on 18 Jun 2012, 07:21 PM
Worked like a charm!
Thanks,
Steve
Tags
ContextMenu
Asked by
Steve
Top achievements
Rank 1
Answers by
Dani
Telerik team
Steve
Top achievements
Rank 1
Share this question
or