Children of VirtualizingStackPanel are not refreshed

5 posts, 0 answers
  1. Artem
    Artem avatar
    3 posts
    Member since:
    Jun 2011

    Posted 15 Mar 2014 Link to this post

    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
  2. Artem
    Artem avatar
    3 posts
    Member since:
    Jun 2011

    Posted 15 Mar 2014 in reply to Artem Link to this post

    I'm not sure but it looks like it happens only for the VirtualizingStackPanels that are inside of Popup.
  3. Boyan Boev
    Admin
    Boyan Boev avatar
    1039 posts

    Posted 20 Mar 2014 Link to this post

    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
     
  4. Artem
    Artem avatar
    3 posts
    Member since:
    Jun 2011

    Posted 20 Mar 2014 in reply to Boyan Boev Link to this post

    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

  5. Boyan Boev
    Admin
    Boyan Boev avatar
    1039 posts

    Posted 20 Mar 2014 Link to this post

    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
     
Back to Top