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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 13, 20262026-05-13T14:46:24+00:00 2026-05-13T14:46:24+00:00

My problem is rather simple. I have a ListBox, containing Thumnails (Image) <ListBox Name=ListBox_Thumbnails

  • 0

My problem is rather simple.

I have a ListBox, containing Thumnails (Image)

<ListBox Name="ListBox_Thumbnails" ItemsSource="{Binding}" DataContext="{Binding Source= {StaticResource ThumbnailListSource}}" Width="120" HorizontalAlignment="Left" Margin="-1,26,0,54">
<ListBox.ItemTemplate>
    <DataTemplate>
        <StackPanel>
            <Image Source="{Binding Path=absolutePath}" MouseLeftButtonDown=<!--?????-->/>
        </StackPanel>
    </DataTemplate>
</ListBox.ItemTemplate>

I wanted to show an image, but as a new StackOverFlow user, I can’t. You can find the image here:

http://www.freeimagehosting.net/uploads/61aa983cad.jpg

(For those who don’t trust me, I explain here the content of the image:
On the left, there is a list of thumbnails (displayed vertically) and on the right there is a bigger image, corresponding per default to a large image of the first thumbnail).

When I click on a thumbnail (on the left), the large image on the right should be updated by the one that I clicked on.

As I am new with WPF, my approach is perhaps totally wrong with the ListBox.
Please, WPF Gurus, show me the light!

  • 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-05-13T14:46:24+00:00Added an answer on May 13, 2026 at 2:46 pm

    I guess, you can use events on ListBox, smth like SelectionChanged… but that’s totally not the TRUE WPF-Jedi way — remember, code-behind is the dark side! =)

    Think data binding, that’s the Force. Bind your large Image element’s source to the SelectedItem property of the ListBox. It should look like

    <Image Source="{Binding SelectedItem.absolutePath, ElementName=ListBox_Thumbnails}">
    

    P.S. Every WPF-databinding-jedi should have this cheat sheet nearby.

    P.P.S. Actually, as you’re using ItemTemplate this might not work, you’ll have your StackPanel as the selected item… in this case you can try the SelectedValuePath trick, set it to “absolutePath” and bind the large image to the SelectedValue property.

    So your ListBox opening tag becomes:

    <ListBox Name="ListBox_Thumbnails" ItemsSource="{Binding}" DataContext="{Binding Source= {StaticResource ThumbnailListSource}}" Width="120" HorizontalAlignment="Left" Margin="-1,26,0,54" SelectedValuePath="absolutePath">
    

    And your large image tag becomes:

    <Image Source="{Binding SelectedValue, ElementName=ListBox_Thumbnails}">
    
    • 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 a rather simple ItemTemplate defined - containing a TextBlock
I have a rather simple problem with ASP.NET. I have a grid view with
I have a rather simple problem, but I am unable to get my head
A rather simple problem... XML Fragment: <bean id='Juicer'> <property name=electric> <value>false</value> </property> </bean> <bean
I have a rather strange problem. I have a very simple application that reads
I have a rather frustrating problem where the maximum number of available DatePicker's on
We have an x-files problem with our .NET application. Or, rather, hybrid Win32 and
So my problem is rather simple and complex at the same time. I am
I have rather simple HttpClient 4 code that calls HttpGet to get HTML output.
Good evening, people! I'm trying to solve a rather simple problem, but.. well, it

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.