This is a migrated thread and some comments may be shown as answers.

Children of VirtualizingStackPanel are not refreshed

4 Answers 177 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Artem
Top achievements
Rank 1
Artem asked on 15 Mar 2014, 03:07 PM
Hi all,
I'm trying to create UI automation test for my silverlight app and I have a problem.
There is ItemsControl with VirtualizingStackPanel where I show some items.
Firstly the ItemsControls contains 40 items and then I use search that limits the number of items.
But when I look the property "Children" of VirtualizingStackPanel it still has 40 elements.
I tried to call the method "Refresh" (of the virtualizing stack panel).
Tried to call App.RefreshVisualTrees().
But nothings helps.
I'm sure that the tree contains only 1 element (I see it using XAML Spy).
But VirtualizingStackPanel still has 40 elements.
Does anybody know some way to force "true"-refresh?

The version I currently use: 2013.2.1327.0

Thanks in advance for any help,
Artem

4 Answers, 1 is accepted

Sort by
0
Artem
Top achievements
Rank 1
answered on 15 Mar 2014, 03:42 PM
I'm not sure but it looks like it happens only for the VirtualizingStackPanels that are inside of Popup.
0
Boyan Boev
Telerik team
answered on 20 Mar 2014, 08:38 AM
Hi Artem,

Please try to refresh also the ItemsControl.

Does this help?

Regards,
Boyan Boev
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
0
Artem
Top achievements
Rank 1
answered on 20 Mar 2014, 10:41 AM
Hi Boyan,

Thanks for your response. Refreshing of the ItemsControl didn't help.
But I found the solution:
1) I call the method App.RefreshVisualTrees()
2) I use App.Find.ByType<VirtualizingStackPanel>() to get the new instance of the virtualizing stack panel (this new instance contains the correct number of children in opposite to the old instance that stays not changed)


Regards,
Artem Zagorodnyuk

0
Boyan Boev
Telerik team
answered on 20 Mar 2014, 02:51 PM
Hello Artem,

Glad to hear that!

If you need further help, please do not hesitate to contact us.

Regards,
Boyan Boev
Telerik
 
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
 
Tags
General Discussions
Asked by
Artem
Top achievements
Rank 1
Answers by
Artem
Top achievements
Rank 1
Boyan Boev
Telerik team
Share this question
or