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

  • Home
  • SEARCH
  • 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 199837
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T17:03:30+00:00 2026-05-11T17:03:30+00:00

I have listbox and on click event I open new panel where i change

  • 0

I have listbox and on click event I open new panel where i change data of listbox, more accurately image source. I have problem how to update listbox to have new picture. Thanks in advance.
Here is my code:

<ListBox x:Name="lbNarudzbe" MouseLeftButtonUp="lbNarudzbe_MouseLeftButtonUp" HorizontalAlignment="Center" MaxHeight="600">
                    <ListBox.ItemTemplate>
                        <DataTemplate>
                            <StackPanel Orientation="Horizontal">
                                <Image Margin="0,5,0,0" Width="50" Height="50" HorizontalAlignment="Center" Source="{Binding Path=Picture}" />
                                <TextBlock HorizontalAlignment="Center" FontSize="23" Text="{Binding Path=UkupnaCijena}" Width="80"/>
                            </StackPanel>
                        </DataTemplate>
                    </ListBox.ItemTemplate>
                </ListBox>




public partial class Page : UserControl
    {
        ObservableCollection<Narudzba> narudzbe = new ObservableCollection<Narudzba>();

        public Page()
        {
            InitializeComponent();

            narudzbe.Add(new Narudzba());
            narudzbe.Add(new Narudzba());
            narudzbe.Add(new Narudzba());
            narudzbe.Add(new Narudzba());

            lbNarudzbe.ItemsSource = narudzbe;

        }





     public class Narudzba
            {
               //...
                public string Picture
                {
                    get { return "picture source"; }
                }.....
  • 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-11T17:03:30+00:00Added an answer on May 11, 2026 at 5:03 pm

    Basically when you want to update the picture in the listbox, you are updating the Picture property of your Narudzba class, and since your Narudzba class does not implement the INotifyPropertyChanged interface the listbox can’t update the picture.

    Here’s some code that might help.

        public class Narudzba : System.ComponentModel.INotifyPropertyChanged
    {
        public event System.ComponentModel.PropertyChangedEventHandler PropertyChanged;
        void Notify(string propName)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new System.ComponentModel.PropertyChangedEventArgs(propName));
            }
        }
    
        string _picturesource;
    
        public string Picture
        {
            get { return _picturesource; }
            set 
            { 
                _picturesource = value;
                Notify("Picture");
            }
        }
    
        public Narudzba(string picturesource)
        {
            _picturesource = picturesource;
        }
      }
    }
    

    Then the lbNarudzbe_MouseLeftButtonUp event code should look like this

        private void lbNarudzbe_MouseLeftButtonUp(object sender, MouseButtonEventArgs e)
        {
            Narudzba nb  = (Narudzba)lbNarudzbe.SelectedItem;
            nb.Picture = "http://somedomain.com/images/newpicture.jpg";            
        }
    

    HTH.

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

Sidebar

Related Questions

I have a listbox which acts as a list of items. If you click
I have a button that on click event I get some information from the
I have a problem scenario like this:- 1) Listbox with values like Car, Scooter
Within a Listbox control I have a Data Template which consists of text and
So there is a parameter box that open after a button click event runs
I am not able to get MouseDoubleClick event fired for my ListBox. I have
I have hooked into the ListBoxItems' double-click event using the ff. code in my
In my project, I have a list box. When I click an item on
I have ListBox called lstProductGroups. On a simple Windows Form, a method called GetGroups
I have a ListBox and I need to repeat the styles to be the

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.