Hafiz H
Hafiz H

Reputation: 399

Avoid animation of the parent of context menu in windows phone 8.1

I have a context menu in a grid which is in a listbox itemtemplate. When long pressed it shows the context menu with a slight animation of the list box item (Grid).

enter image description here

I just need to remove the popping up animation of the listbox item, since the content looks like out of focus.

My Code

<ListBox.ItemTemplate>
                    <DataTemplate>
                        <Grid Margin="15,10,0,10" Height="80" Width="auto" Tag="{Binding .}">
                            <toolkit:ContextMenuService.ContextMenu>
                                <toolkit:ContextMenu Opened="ContextMenu_Opened">
                                    <toolkit:MenuItem Header="delete" Tag="{Binding .}" Click="Delete_MenuItem_Click" />
                                </toolkit:ContextMenu>
                            </toolkit:ContextMenuService.ContextMenu>

Sorry if the question is dumb!!

Upvotes: 1

Views: 89

Answers (1)

Matt
Matt

Reputation: 1582

All you need to do is set IsZoomEnabled="False".

So in your case it would be:

<ListBox.ItemTemplate>
                <DataTemplate>
                    <Grid Margin="15,10,0,10" Height="80" Width="auto" Tag="{Binding .}">
                        <toolkit:ContextMenuService.ContextMenu>
                            <toolkit:ContextMenu IsZoomEnabled="False Opened="ContextMenu_Opened">
                                <toolkit:MenuItem Header="delete" Tag="{Binding .}" Click="Delete_MenuItem_Click" />
                            </toolkit:ContextMenu>
                        </toolkit:ContextMenuService.ContextMenu>

Upvotes: 2

Related Questions