Tags: | Categories: Code Snippets Posted by Vitaly Zayko on 6/6/2011 7:01 PM | Comments (0)

Faced an interesting problem: when I want to change ApplicationBar visibility by by changing instance IsVisible property, I always get NullReference exception. To avoid this use static member instead:

 ApplicationBar.IsVisible = true;

Guess why? Because ApplicationBar is not a Silverlight element and general behavior doesn’t apply to it.

Update: the same happens when you want to add/remove a button – so use static Button property.

Comments are closed