LayoutUpdated Event

3 posts, 1 answers
  1. Phillip Garrett
    Phillip Garrett avatar
    25 posts
    Member since:
    Apr 2010

    Posted 29 Apr 2010 Link to this post

    Hi,

    Could you explain the LayoutUpdated event. Specifically when it gets called.
    I've hooked up this event and it seems to be called by strange sources.

    The situation:
    My application has a RibbonBar, a RadWindow (which I attach the LayoutUpdated event to) and a UserControl inside that RadWindow.
    The UserControl takes sometime to load (because it communicates with a database) - so I want this LayoutUpdated to fire once all the content is loaded then I can center and size the RadWindow correctly.

    This seemed to work fine however when I checked to see when my LayoutUpdated event handler gets called, it was being called on some strange events like when I simply mouse over the RibbonBar!

    I only really want my event handler to be called once - after the data has loaded. Could you help? is there an event I've overlooked that accomplishes this? or a way of tailoring my LayoutUpdated event handler to detect only the correct situation?

    Thanks
  2. Answer
    Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 29 Apr 2010 Link to this post

    Hello Phillip,

     Most probably the event you are searching for is not LayoutUpdated, but SizeChanged. You could take a look at the following MSDN reference: http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.layoutupdated(VS.95).aspx and on the following article that explains what happens in very interesting manner: http://www.dotblogs.com.tw/kan/archive/2009/03/03/7352.aspx.

    Best wishes,
    Miroslav Nedyalkov
    the Telerik team

    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
  3. DevCraft banner
  4. Phillip Garrett
    Phillip Garrett avatar
    25 posts
    Member since:
    Apr 2010

    Posted 29 Apr 2010 Link to this post

    Yep SizeChanged is the event I was after - much more civilized :)
    Thanks.
Back to Top