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

LayoutUpdated Event

2 Answers 49 Views
Window
This is a migrated thread and some comments may be shown as answers.
Phillip Garrett
Top achievements
Rank 1
Phillip Garrett asked on 29 Apr 2010, 01:42 PM
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 Answers, 1 is accepted

Sort by
0
Accepted
Miroslav Nedyalkov
Telerik team
answered on 29 Apr 2010, 01:55 PM
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.
0
Phillip Garrett
Top achievements
Rank 1
answered on 29 Apr 2010, 02:03 PM
Yep SizeChanged is the event I was after - much more civilized :)
Thanks.
Tags
Window
Asked by
Phillip Garrett
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Phillip Garrett
Top achievements
Rank 1
Share this question
or