showing progress message not working

Mar 6, 2011 at 12:54 PM

I have a  method on the shelviewmodel that starts a piece of code, that runs for some time. I want to show progress information.

I have a property StatusMessage on the shellviewmodel, and some textblock on the shellview.xaml is bound to this property.
At different places in de code run from the shellviewmodel, I update the shellviewmodel's StatusMessage property. This StatusMessage property implements the notifyproperty changed.

But when I run the code, the textblock does not get updated, I even tried to put a Sleep method of 5 seconds inside the code, to be sure it has enough time for updating to occur, still the textblock
does not update. I"m  I missing something ?

This is the definition of my statusmessage property:

        private string _statusMessage;
        public string StatusMessage
            get { return _statusMessage;}
            set { _statusMessage= value; NotifyOfPropertyChange(() => StatusMessage); }
I have a method on the shellviewmodel that gets called for updating the StatusMessage:
       public void Update(string progressInfo)
            //Caliburn.Micro.Execute.OnUIThread(() => {  StatusMessage = progressInfo; });
            StatusMessage = progressInfo;
As you can see, I also tried to use explicit OnUIThread method (but I think normally this is not necessary).


Mar 6, 2011 at 1:26 PM

Hmm. Can you email me a sample that reproduces the problem? What you are trying should work. I need to have a look at it more closely to determine what is going wrong. Feel free to email me at robertheisenberg at hotmail dot com

Mar 6, 2011 at 3:46 PM

I've send an email with test project to you.