IPleaseWaitService and InterestedIn Attribute

Topics: Issues / bugs
Jun 12, 2012 at 8:10 AM

Hello

In my Application I use the IPleaseWaitService in Combination with the InterestedIn Attribute.
So here a short part of my code.

    [InterestedIn(typeof(OtherViewModel))]
    public class MyViewModel : ViewModelBase
    {
        protected override void OnViewModelPropertyChanged(IViewModel viewModel, string propertyName)
        {
            // ProfilePage
            if (viewModel is OtherViewModel)
            {
                if (TagHelper.AreTagsEqual(propertyName, "ActiveComponent"))
                {
                    var wait = IoCHelper.UnityContainer.Resolve<IPleaseWaitService>();
                    wait.Show("Loading");
		  ...
                }
            }
         }
     }

When i call the wait.Show() Method here the ActiveComponet Property in the "OtherViewModel" is changed again. But only then.

Why  the Show Method change the property?

Coordinator
Jun 12, 2012 at 8:13 AM

I have no idea. Probably because the active component is somehow bound to a UI element (which is currently active)? The pleasewaitwindow disables the parent window by default, probably that's why you see the property change again.

Jun 12, 2012 at 1:27 PM

Ok. Maybe thats the error. ActiveComponent is bound to an UI element, thats wright. But its not active. Hm.

Coordinator
Jun 12, 2012 at 6:16 PM

The StackTrace will reveal all the secrets for you.

Jun 14, 2012 at 1:08 PM

Ok. So maybe there is a solution like set DisableEvents  when the PleaseWaitService is shown?

Coordinator
Jun 14, 2012 at 1:16 PM

I am sorry. In the past, the PleaseWaitWindow disabled the parent window, but since lots of people bind to the IsEnabled property, we decided to no longer do that. We now set IsHitTestVisible to false.

Do you have a repro so we can look into this issue with a real example?

Jun 27, 2012 at 9:02 AM
GeertvanHorrik wrote:

We now set IsHitTestVisible to false.

Since which version?

Coordinator
Jun 27, 2012 at 9:03 AM

3.0 or maybe even earlier, not sure.

Jun 28, 2012 at 8:08 AM

Strange. So I don't know why this happens.

Coordinator
Jun 28, 2012 at 8:10 AM

If you can provide a small repro, we can take a look at it. But we won't fix this in 3.2 because it is stable and we will only make fixes that are really necessary.