WPF - Figuring Out Who Changed Window Size

  • Thread starter Thread starter Wonko the Sane
  • Start date Start date
W

Wonko the Sane

Hello--

Is there a "WPF way" of telling why a Window's size was changed? In other
words, is there a way to tell if the dialog was dragged bigger by the user
versus a window automatically resizing due to a textbox getting wider from
content pasted (or bound, or...)

Thanks,
WtS
 
Hi,

Do you mean that you are using SizeToContent="WidthAndHeight" property on
your Window (which makes the window to automatically resize if its content
is changed) and you need to know if the SizeChanged event of the Window is
caused by content change or user resizing?

If this is the case, then I think you can check the SizeToContent property
in SizeChanged event, if it's now "Manual" instead of "WidthAndHeight",
means it's caused by user resizing since the user resizing code will
automatically change the property to "Manual".

If this is not the case, then please post some code to let us better
understanding your scenario and requirement. Thanks.


Regards,
Walter Wang ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.
 
Back
Top