The following forum(s) are migrating to a new home on Microsoft Q&A (Preview): Developing Universal Windows apps!

Ask new questions on Microsoft Q&A (Preview).
Interact with existing posts until December 13, 2019, after which content will be closed to all new and existing posts.

Learn More

Dynamically change Visibility of HubSection RRS feed

  • Question

  • Hey folks,

    I am facing a problem in my application. I am having a Hub xaml control in my View. Two HubSetions are binded to a ViewModel property that determine the Visibility of the HubSection. The default value is Visibible. After navigating to the page an async method get some information from the web and may change or may not change those Visibility properties. If one is pulled to Collapse, my app crashes, giving me an "incorrect Parameter" error.

    If both are pulled to Collapse, my app does not crash, but the Hub control loses its possibility to scroll to left and right side.

    Am I not allowed to change the Visibility of a HubSection once the page is loaded?

    Or do I have to remove it by code in the code behind?

    Code Snippet:


    <HubSection Visibility="{Binding DishOfTheDayVisibility}">



    private Visibility _DishOfTheDayVisibility
    public Visibility DishOfTheDayVisibility         {             get            {                return _DishOfTheDayVisibility;            }             set             {                 _DishOfTheDayVisibility = value;         RaisePropertyChanged("DishOfTheDayVisibility");           }         }


    Best Regards


    Tuesday, July 1, 2014 8:40 PM

All replies