The control loads with initial state expanded

Jan 19, 2015 at 7:27 PM
Hello

Congratulations for the great work.

I am using the expander in combination with listBox . Each list item is a expander.
Everything works ok, except some random cases where the expander has an initial state Expanded with empty items in the expanded area.

Anyone has noticed this issue ?
Coordinator
Jan 30, 2015 at 8:05 PM
Hi!

Nothing i have notice by myself. What happens then? Can you provide a code snippet?
Feb 4, 2015 at 2:25 PM
As you see in the first image below, the red rectangle is the item. The blue rectangle is the expanded area. In this first stage as I said before it appears empty and expanded. It is supposed to appear as non expanded, with header information only.

This happens randomly. In the second image you see the normal expanded item. With details in expanded area.

We have used the expander in different forms of the application, and this happens in all of the forms. Thats why I can't give a code snippet


FIRST IMAGE
Image

SECOND IMAGE
Image
Coordinator
Feb 14, 2015 at 9:04 AM
I really understand if you can't give some actual code snippet from your app. The problem is that i can't repro. the problem. Please try to put a test app with the same expanderview setting and see if that will repro the problem. Let me know then and share the test app so i can look at it.
Feb 20, 2015 at 10:19 AM
Edited Feb 20, 2015 at 10:19 AM
Ok I found the problem and changed this line of code of the expander style (in the ExpanderControl.xaml file)

<Canvas x:Name="ItemsCanvas" Grid.Column="1" Margin="11,0,0,0" Opacity="0.0" Grid.Row="2" Width="{Binding ActualWidth, ElementName=Presenter}" Height="{Binding ActualHeight, ElementName=Presenter}"

With this

<Canvas x:Name="ItemsCanvas" Grid.Column="1" Margin="11,0,0,0" Opacity="0.0" Grid.Row="2" Width="{Binding ActualWidth, ElementName=Presenter}" >

So , i just removed the Height property.
I am using the expander now and no problems so far.

Thanks