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 8229073
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:40:40+00:00 2026-06-07T16:40:40+00:00

I’m working on a small Windows Phone 7 Silver Light app. I simply want

  • 0

I’m working on a small Windows Phone 7 Silver Light app. I simply want a context menu to pop up over an item in a Listbox when the user taps and holds on the respective entry. I’ve read through several posts and the most common answer given is to use the Silverlight toolkit. I was excited since I already have it set up and use it for a few other things in the app. So I found a tutorial that explains how to set it up on a button. It failed when I tried because I was setting the content for the button twice:

    <Button Width="Auto" MinWidth="460" Height="Auto" HorizontalAlignment="Stretch">
        <Button.Content>
            <toolkit:GestureListener Hold="GestureListener_Hold" />
            <StackPanel ..... >
                .......
            </<StackPanel>
        </Button.Content>
    </Button>

Which tells me “The property ‘Content’ is et more than once.
So after searching again I found a nice article, http://forums.create.msdn.com/forums/t/85263.aspx, which shows that I can move the statement to look more like:

    <StackPanel Orientation.....>
        <toolkit:GestureListener Hold="GestureListener_Hold" />  
        <TextBlock
            Text="{Binding ItemName}" FontSize="{StaticResource PhoneFontSizeLarge}"
            HorizontalAlignment="Stretch" VerticalAlignment="Center" Height="40"/>
    </StackPanel>

Which tells me “A value of type ‘GestureListener’ cannot be added to a collection or dictionary of type ‘UIElementCollection’.

I’d appreciate any help on either method or a brand new one.
Thanks in advance!

  • 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-07T16:40:42+00:00Added an answer on June 7, 2026 at 4:40 pm

    You need to set the GestureListener as the value of the GestureService.GestureListener attached property:

    <Button Width="Auto" MinWidth="460" Height="Auto" HorizontalAlignment="Stretch"> 
        <Button.Content> 
            <StackPanel ..... > 
                <toolkit:GestureService.GestureListener>
                    <toolkit:GestureListener Hold="GestureListener_Hold" />
                </toolkit:GestureService.GestureListener>
                ....... 
            </<StackPanel> 
        </Button.Content> 
    </Button> 
    

    For what it’s worth, the toolkit already includes a ContextMenu helper. See here

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
I used javascript for loading a picture on my website depending on which small
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function
I want use html5's new tag to play a wav file (currently only supported
I have a French site that I want to parse, but am running into
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I want to show the soap response to UIWebview.. my soap response is, <p><img
I want to construct a data frame in an Rcpp function, but when I

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.