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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T22:39:35+00:00 2026-05-15T22:39:35+00:00

I have a progress bar bound to 2 integer values – One is the

  • 0

I have a progress bar bound to 2 integer values – One is the total seconds and the other is the seconds left (which counts down on a timer: always <= Total seconds).

I have the LayoutRoot datacontext set to my top level object (of which BlindSet is a property -see code).

When I run the project the progress bar updates perfectly. It counts down the number of seconds as expected. I then change the datacontext by instantiating a new object and setting it to the BlindSet class. I use DataChanged notification events to let the UI know it has changed. This also works well – all other controls, EXCEPT the progress bar, update accordingly.

It’s got me baffled, so I simplified it down to this:

2 textblocks and the progress bar, all bound to the same values. The datacontext is set higher up so it’s the same for all of them.

The textblocks show the correct values counting down. (BlindSet.TimeLeftInCurrentBlind.TotalSeconds counts down on a timer) but the progress bar never updates again after I change the datacontext. I even tried rebinding it after the datacontext change but that did not help.

I also bind the ToolTip on the progress bar to the same value as Value is set to – and when you hover over the non-updating progress bar you can see it counting down correctly… but the progress bar does not show it.

Either I am doing something really stupid (possible 😉 or it is a bug in the progress bar control.

xaml:

<TextBlock Text="{Binding BlindSet.CurrentBlind.SecondsPerBlind}"  />
<TextBlock Text="{Binding BlindSet.TimeLeftInCurrentBlind.TotalSeconds}" />

<ProgressBar Minimum="0" Maximum="{Binding BlindSet.CurrentBlind.SecondsPerBlind}" Value="{Binding BlindSet.TimeLeftInCurrentBlind.TotalSeconds}" ToolTipService.ToolTip="{Binding BlindSet.TimeLeftInCurrentBlind.SecondsPerBlind}" />

Code behind:

LayoutRoot.DataContext = tournament;

tournament has a BlindSet object, but I don’t think this is part of the problem as the other controls are updating fine:

  public Blindset BlindSet
    {
        get { return blindset; }
        set
        {
            if (blindset != value)
            {
                blindset = value;
                OnPropertyChanged("BlindSet");
                OnPropertyChanged("CurrentBlind");
            }
        }
    }

Update: Perhaps there is some internal state that needs to be reinitialised with the new max and value values when the datacontext changes (the values are very different, e.g 1200 seconds or 120 seconds).

When I bind to a new BlindSet object with the same values (ie. 1200 seconds) then it works as expected – so I think I need to somehow give it a kick to recalculate the small or large value changes – any idea how?!

  • 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-15T22:39:36+00:00Added an answer on May 15, 2026 at 10:39 pm

    I’ve just read this in the comments section of a blog article, I hope it helps.

    Just so everyone knows. The ProgressBar (at least as of Silverlight 3 – Sept 2009) does not work very well with databinding. It only partially works. So you may want to consider this in your design until such time as it is fixed.
    1) Cannot change DataContext without changing to Null first. Thus inherited bindings usually don’t work.
    2) Visibility cannot be databound. (You can try, but it always works as if you had set Mode=OneTime)
    3) Other bindings don’t seem always stable either…
    Hope that helps somebody avoid frustration.

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

Sidebar

Ask A Question

Stats

  • Questions 494k
  • Answers 494k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer In my .tcshrc: set history=2000 set savehist=(2000 merge) May 16, 2026 at 11:08 am
  • Editorial Team
    Editorial Team added an answer The problem is on my Linux machine Maybe ksh version… May 16, 2026 at 11:08 am
  • Editorial Team
    Editorial Team added an answer You need to reimplement QCoreApplication::winEventFilter in your QCoreApplication / QApplication… May 16, 2026 at 11:08 am

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

Related Questions

I have some difficulties finding the correct way to specify that a progress bar
I have one form as shown below: Page 1: <form name = form1 method=post
I have a WPF application which is built on the MVVM design pattern. I
I have a ListView with different DataTemplate s set up to bind. I want
I have a INotifyPropertyChanged derived class with a Volume property (float, 0.0f - 1.0f)
i have a parent usercontrol, here is an excerpt of xaml <Grid x:Name=LayoutRoot Width=Auto
I have used ProgressBar Control in my c# desktop application.I have used it in
I have a form with two places that use ajax to submit the information
This is for the swing experts out there. I have spent considerable time on
I currently use the following code to upload one file to a remote server:

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.