0

I have a user control that is a spinning "wait" graphic. I've added it to a form and I set-up a convention in Caliburn.Micro using the code from this thread

I then created a property following the naming convention and named this user control accordingly:

<uc:LoadSpinner x:Name="Authenticating" />

My property looks like this:

        protected bool _authenticatingIsVisible = false;
        public bool AuthenticatingIsVisible
        {
            get { return _authenticatingIsVisible; }
            set
            {
                _authenticatingIsVisible = value;
                NotifyOfPropertyChange(() => AuthenticatingIsVisible);
            }
        }

I can see the control get bound and when the form starts up, the spinner is invisible. However, when I set it visible it still doesn't appear. To simplify things and test the binding I then created a rectangle on the form and named it the same way. It appears/disappears as expected. So it seems like it's either something specific to a user control or animations.

I also tried wrapping the user control inside of a Border control and naming it the same way (the idea was if normal controls worked, then the contained user control should appear/disappear when the Border does). Nope.

Why isn't this working?

Community
  • 1
  • 1
Paul Mrozowski
  • 6,604
  • 9
  • 34
  • 47
  • don't you need to bind to Visibility.Visible/Collapsed/Hidden instead of true or false? – Theodosius Von Richthofen Apr 17 '15 at 18:41
  • Since it works fine with other controls it would seem like this is working correctly. However, I had previously tested this by manually binding and using a BooleanToVisibility converter with the same results. – Paul Mrozowski Apr 17 '15 at 19:26
  • Have you tried starting with the Spinner as visible just to see if there is something wrong wiith the actual spinner? – Moddaman Apr 18 '15 at 08:51

1 Answers1

0

Theodosius Von Richthofen is correct. You want to use Visibility not bool. Try this:

protected Visibility _authenticatingIsVisible = Visibility.Hidden;
    public Visibility AuthenticatingIsVisible
    {
        get { return _authenticatingIsVisible; }
        set
        {
            _authenticatingIsVisible = value;
            NotifyOfPropertyChange(() => AuthenticatingIsVisible);
        }
    }