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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T14:30:28+00:00 2026-06-15T14:30:28+00:00

I have a custom listbox. Some of the collections’s items have fields "name", "text",

  • 0

I have a custom listbox. Some of the collections’s items have fields "name", "text", "image" and "url". Other may have other fields (a use a template selector). So, if item has fields "name", "text", "url" and "image" – it shows in listbox as 2 textblocks and 1 image. When I tap on the image – program must open new window, open webBrowser and go to URL which is in the item’s property "url". I understand how to transmit info from one page to other, but I can’t understand how to get the "url" from item. I tried

    private void Video_Tap(object sender, GestureEventArgs e) // event when tap on the image
    {
        New tmp = ((sender as ListBox).SelectedItem as New); // New - is the type of collection's item
        string vid = tmp.Video.url; // Video has fields "image" and "url"

        string destination = string.Format("/Video_Page.xaml?uri={0}", vid );
        NavigationService.Navigate(new Uri(destination, UriKind.Relative));
    }

but sender has an image type.

  • 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-15T14:30:29+00:00Added an answer on June 15, 2026 at 2:30 pm

    You can call Parent of the Image sender to get its container (or call it multiple times, depending on how your xaml is structured), then look into the container’s Children to find the textbox you are looking for. For example, maybe you’d want to do something like this (with setting the Tag property of the textbox that contains your url in xaml).

    var grid = (Grid) ((Image) sender).Parent;
    foreach (var child in grid.Children)
    {
        if (child is TextBox && ((TextBox) child).Tag == "URL")
        {
            return (Textbox) child;
        }
    }
    

    Or, if you just want an always-available reference to the ListBox, just set its x:Name = "_MyListbox" in xaml, and it will become a field of the class.

    As a final option, I’m thinking it might just be easier for you to bind to ListBox.SelectedItem, so that you always have some property that contains the currently selected New item.

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

Sidebar

Related Questions

I have a listbox, with custom items. Code: <ListBox Height=600 HorizontalAlignment=Left Margin=7,6,0,0 Name=friendList VerticalAlignment=Top
I have a custom panel for a listbox <ItemsPanelTemplate x:Key=FloatPanelTemplate> <Controls:FloatPanel x:Name=CardPanel /> </ItemsPanelTemplate>
I have a listbox that displays Shipment Items (custom class) that are formatted using
I have a ListBox displaying items with a template something like this: <ListBox x:Name=CustomerResultList
I have a WPF listbox with custom items. Each item is a user control
I have a custom ItemTemplate for a ListBox and I need to bind a
I have a custom user control extending the Listbox class. Inside of it I
I have a listbox inside a custom control. I use this custom control into
I have 2 listboxes, the first listbox stores data pointers for each items Object
I am making a custom Listbox (for the compact framework). I have made an

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.