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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T09:19:31+00:00 2026-06-01T09:19:31+00:00

Im busy with my app and i walked in some problems when i click

  • 0

Im busy with my app and i walked in some problems when i click on a photo in my listbox PhotoFeed.

I got 1 List<> with in it the strings UrlTumb and UrlFull.

I got 1 ListBox with in it a WrapPanel filled with images wich i set the Image.Source from my UrlTumb.

What my problem is when i click on a photo in my listbox i want to navigate to a new page and display there the original image (UrlFull) now i can only get my UrlTumb from my Image.Source but i want my UrlFull which is stored in the List. Now is my question how do i obtain the UrlFull. So how can i back trace which item i clicked and get the UrlFull from that item so i can send it with my NavigationService.Navigate

I can do it on an dirty way and create an invisible textblock besides the image in my ListBox and put the UrlFull in there but i would like to do it in a proper way

So what do i place in the ????? spot in this line

            NavigationService.Navigate(new Uri("/PhotoInfo.xaml?urlfull={0}", ????? , UriKind.Relative));

Greetings Cn

  • 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-01T09:19:32+00:00Added an answer on June 1, 2026 at 9:19 am

    There are multiple options:

    1. Use selected item’s index listBox.SelectedIndex to get the index
      of the selected property which will correspond to the index in your
      source (it might not if you filter the collection using collection
      source, but I think that is not the case)
    2. Use selected item listBox.SelectedItem this will return the
      SelectedItem which will contain your object. (Note, that if your
      selection mode set to multiple, this will return only the firstly
      selected item)
    3. Use SelectemItems. It will allow you to get an array of selected
      items (Note: this should be normally used only when your list’s
      selection mode is set to multiple)
    4. Use SelectedValue, which will contain the value of the SelectedItem
      (this will save you and extra step.
    5. Use arguments of the Selection changed event AddedItems.

    Bellow is the code snippet of 3 options above. x, y, z will all be your selected names (e.g. “Mike”)

    XAML:

    <ListBox x:Name="lb"
             ItemsSource="{Binding Names}"
             SelectionChanged="NameChanged" />
    

    Code behind:

        public class Person
        {
            public string Name { get; set; }
    
            public override string ToString()
            {
                return Name;
            }
        }
    
        private List<Person> people = new List<Person>
            {
                new Person{Name = "Lewis"},
                new Person{Name = "Peter"},
                new Person{Name = "Brian"}
            };
    
        public List<Person> People
        {
            get
            {
                return this.people;
            }
            set
            {
                this.people = value;
            }
        }
    
        private void NameChanged(object sender, SelectionChangedEventArgs e)
        {
            var x = this.people[lb.SelectedIndex];
            var y = lb.SelectedItem;
            var z = lb.SelectedItems[0];
            var h = lb.SelectedValue;
    
            var u = e.AddedItems[0];
    
            var person = e.AddedItems[0] as Person;
            if (person != null)
            {
                var result = person.Name;
            }
        }
    

    For the differences between SelectedValue and SelectedItem refer here SelectedItem vs SelectedValue

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

Sidebar

Related Questions

I got a (stupid) question. I'm busy with a 'tap' app (i dont know
I am busy making some optimizations to a app of mine, what is the
In my app I've got a thread which displays for some time please wait
I am busy with my group profile app and whenever i click on the
I am busy working on a java app to run on blackberries but on
I'm busy prototyping a training management app using the DevExpress eXpressApp framework & Domain
I use a lot of XML serialization in one app I am busy with.
I've got a legacy app here that has a few 'time-consuming' loops that get
I'm busy with an app you need to touch a button, but when u
I have a very busy Google Maps app that I have built and I'm

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.