Visual Studio and .NET Framework Home
Thank you for your feedback!
WPF LayoutUpdated has sender always null
- by Jan Kučera
as By Design
The product team believes this item works according to its intended design.
A more detailed explanation for the resolution of this particular item may have been provided in the comments section.
8/17/2007 8:54:30 AM
Hi, I think the LayoutUpdated does not set the sender parameter.
ATTACH A FILE
EDIT THIS ITEM
Item can only be reassigned when it is active.
to post a comment.
Please enter a comment.
on 9/5/2008 at 3:43 PM
This is by design. The LayoutUpdated event is a per dispatcher event, meaning that it will fire whenever any element in the queue had a layout update. So an update on some element’s layout will cause other elements’ LayoutUpdated events to be also called. We think that LayoutUpdated may not be the event you want to use. Did you try SizeChanged event to do the job?
The SizeChanged event is an "instance event" that is raised whenever the size of the element you have attached the handler to has changed.
NOTE: If the position of the element on the screen changes, but not its size, this event does not get raised.
The LayoutUpdated event is a "static event" that is fired every time layout has been updated anywhere in the element tree, not just the element you have attached the handler to.
You might also want to look at this article on http://blogs.msdn.com/devdave/archive/2008/05/27/layout-events-sizechanged-and-layoutupdated.aspx. It’s related to Silverlight, but the explanation applies well to the WPF case.
Kindly clarify the feature you are trying to implement.
on 10/8/2007 at 4:14 PM
This bug renders the LayoutUpdated event useless in most scenarios. Hope it's going to be fixed sometime soon.
on 8/19/2007 at 10:42 PM
Thanks for your feedback. We have reproduced this bug on Visual Studio 2008 Beta 2, and we are sending this bug to the appropriate group within the VisualStudio Product Team for triage and resolution.
Visual Studio Product Team.
on 8/19/2007 at 5:15 PM
Thank you for your feedback. We are currently investigating. If this issue is urgent, please call support directly (see http://support.microsoft.com).
Visual Studio Product Team
to post a workaround.
Please enter a workaround.
Attach a file
© 2017 Microsoft