Goal:  

When you right click on an empty space the right menu shall NOT display. The picture number two is wrong. 

Problem:  

How should I enable to do it? I don't know the right syntax code.

```
        private void lvw_bokade_MouseRightButtonUp(object sender, MouseButtonEventArgs e)
        {
            ListView selectedData = (ListView)sender;

            List myList= (List) selectedData.SelectedItem;

            ContextMenu myContextMenu = new ContextMenu(); ;

            if (MouseButtonState.Released == e.RightButton && myList.Test!= "")
            {
                MenuItem menuItem3 = new MenuItem();
                menuItem3.Header = "Add quantity";
                myContextMenu.Items.Add(menuItem3);

                MenuItem menuItem2 = new MenuItem();
                menuItem2.Header = "Delete";
                myContextMenu.Items.Add(menuItem2);
            }

            myContextMenu.IsOpen = true;
        }

```

XAML code:

```
    <TabItem Header="Bokade">
        <Grid Background="#FFE5E5E5">
            <ListView x:Name="lvw_bokade" HorizontalAlignment="Left" ItemsSource="{Binding}" SelectionMode="Single" Height="335" Margin="10,46,0,0" VerticalAlignment="Top" Width="561" MouseRightButtonUp="lvw_bokade_MouseRightButtonUp">
                <ListView.View>
                    <GridView>
                        <GridViewColumn Header="Fornamn" Width="auto" DisplayMemberBinding="{Binding Path=Fornamn }" TextBlock.TextAlignment="Left" />
                        <GridViewColumn Header="Efternamn" Width="auto" DisplayMemberBinding="{Binding Path=Efternamn}" TextBlock.TextAlignment="Left"  />
                        <GridViewColumn Header="Kortnummer" Width="auto" DisplayMemberBinding="{Binding Path=Kortnummer}" TextBlock.TextAlignment="Center"  />
                        <GridViewColumn Header="Personnummer" Width="auto" DisplayMemberBinding="{Binding Path=Personnummer}" TextBlock.TextAlignment="Center"  />
                        <GridViewColumn Header="Avprickad" Width="auto" DisplayMemberBinding="{Binding Path=Avprickad }" TextBlock.TextAlignment="Center"  />
                    </GridView>
                </ListView.View>
            </ListView>
            <Button Content="Ny plats" HorizontalAlignment="Left" Margin="10,21,0,0" VerticalAlignment="Top" Width="75"/>
        </Grid>
    </TabItem>

```

![enter image description here](https://i.stack.imgur.com/4SnLC.png)