Silverlight / WPF - 910209 - Where's ResizeEnd event?

Asked By hamid sherkat masoum on 29-Apr-12 08:27 AM
hi
i need to know when resize ends in my Silverlight application. how can i do that?
Devil Scorpio replied to hamid sherkat masoum on 29-Apr-12 02:39 PM
Hi,

U need to check the OnResize event

you have to handle the resize event in siverlight whenever the Silverlight plug-in's object tag is resized and the ActualHeight or the ActualWidth of the Silverlight plug-in change.

This is specified in the HTML/ASP:

<object ...>
    ...
    <param name "onresize" value"functionname" />
    ...
</object>

when the ActualHeight or ActualWidth properties change this is fired  - but when the Silverlight plugin is in full screen mode, this is not fire .
Somesh Yadav replied to hamid sherkat masoum on 30-Apr-12 12:33 AM

Hi,

you can refer to the code below:

        
App.Current.Host.Content.Resized += new EventHandler(Content_Resized);
       
void Content_Resized(object sender, EventArgs e)
       
{
           
var width = App.Current.Host.Content.ActualWidth;
           
var height = App.Current.Host.Content.ActualHeight;
       
}
or

I think you are looking for the silverlight controls LayOutUpdated event.

http://msdn.microsoft.com/en-us/library/system.windows.frameworkelement.layoutupdated%28v=vs.95%29.aspx

hamid sherkat masoum replied to Somesh Yadav on 30-Apr-12 01:34 AM
thank u for ur replies. i'm sorry that i couldn't explain my problem well. indeed i need an event to be raised only when the resize gets completed. i've already tried OnResize and Resized events. they're raised whenever the size of UserControl changes like SizeChanged or LayoutUpdated. so none of these are useful.
for example in a form application we've the ResizeEnd event. we've also Resize event, but it's not useful for my purpose. in a Silverlight application we may realize whenever a control is resized by multiple ways. but my question is that how can we realize when the resize gets complete? that's when user releases the mouse left button and resize ends.