Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7983729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:02:58+00:00 2026-06-04T11:02:58+00:00

This is for Windows Phone 7.5 I am not able to remove menuitems from

  • 0

This is for Windows Phone 7.5

I am not able to remove menuitems from my contextmenu based on the pivotitem. I have three pivotitems and I need to show the custom items in the context menu.

I am trying to find the right event that can help me capture the current pivot item and based on that I would like to present context menu options.

Update #1:

Xaml Markup:

 <controls:PivotItem x:Name="HighPivotItem" Header="high">
        <toolkit:ContextMenuService.ContextMenu>
            <toolkit:ContextMenu Opened="ContextMenu_Opened" 
                           Closed="ContextMenu_Closed">
                <toolkit:MenuItem Header="mark as done" Click="MarkMenuItem_Click"/>
                <toolkit:MenuItem Header="edit" Click="EditMenuItem_Click"/>
                <toolkit:MenuItem Header="delete" Click="DeleteMenuItem_Click"/>
            </toolkit:ContextMenu>
        </toolkit:ContextMenuService.ContextMenu>
        <Grid>
            <TextBlock x:Name="HighTextBlock" Text=""
      Visibility="Collapsed" Margin="22,17,0,0"
 Style="{StaticResource PhoneTextGroupHeaderStyle}" />

            <ListBox x:Name="HighListBox" 
             ItemTemplate="{StaticResource DataTemplate}"
             SelectionChanged="ListBox_SelectionChanged" />
        </Grid>
    </controls:PivotItem>

Here is the code in my event:

void MarkMenuItem_Click(object sender, RoutedEventArgs e)
{
  Task task = (sender as MenuItem).DataContext as Task;

  // Move from the task list to the done list
  Settings.TaskList.Value.Remove(task);
  Settings.DoneList.Value.Add(task);

  RefreshLists();
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:02:59+00:00Added an answer on June 4, 2026 at 11:02 am

    You should be designing your context menus per pivot item

            <controls:Pivot Title="Pivot">
                <controls:PivotItem Header="one" DataContext="{Binding Task}">
                    <!-- Stuff for pivot ONE -->
                    <toolkit:ContextMenuService.ContextMenu>
                        <toolkit:ContextMenu >
                            <toolkit:MenuItem Header="Menu for both"/>
                            <toolkit:MenuItem Header="Menu for item ONE"/>
                        </toolkit:ContextMenu>
                    </toolkit:ContextMenuService.ContextMenu>
                </controls:PivotItem>
                <controls:PivotItem Header="two">
                    <!-- Stuff for pivot TWO -->
                    <toolkit:ContextMenuService.ContextMenu>
                        <toolkit:ContextMenu >
                            <toolkit:MenuItem Header="Menu for both"/>
                            <toolkit:MenuItem Header="Menu for item TWO"/>
                        </toolkit:ContextMenu>
                    </toolkit:ContextMenuService.ContextMenu>
                </controls:PivotItem>
            </controls:Pivot>
    

    The menus can be placed into a datatemplate for a listbox, or onto individual items.

    The example above assumes that the page has a DataContext that has a property “Task”

    public MainPage()
    {
        this.DataContext = new ViewModel { Task = new Task() };
        InitializeComponent();
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am developing a Windows Phone Application and from this application I am accessing
I have made a custom control for windows phone 7. If I use this
Hi i need to post some data to a web server from windows phone
I am very new at all this c# Windows Phone programming, so this is
I'm using Visual Studio 2012 for Windows Phone 7 and this is my first
in my silverlight for windows phone app, i've created this xaml in the mainpage
I'm trying to create a windows phone app with lots of texts like this
I'm looking for a way to unzip a string on Windows Phone. Found this
I am able to successfully execute this on windows: builder = new ProcessBuilder(cmd.exe, /c,
I am building a Windows Phone game using C#/XNA. In the game, I need

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.