Search code examples
c#windows-phone-7silverlight-toolkit

Move other items down when opening ExpanderView


I have four toolkit:ExpanderView items on a page. What I want is for the ExpanderViews below the targeted one to move down, leaving space for the one that I need to open. What can I do to accomplish this?


Solution

  • As I remember, each exapnder has an "IsExpanded" Property. Just set it to "True" to show or to "False" to collapse and give other stuff more space. Possible by Databinding and as codebehind.

    private void SetExpanded(bool expand)
    {
        foreach (object item in this.listBox.Items)
        {
            CustomPizza customPizza = item as CustomPizza;
            if (customPizza != null)
            {
                customPizza.IsExpanded = expand;
            }
        }
    }