Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

silverlight 3: How to create a resizable childwindow?

Is there any way to create a resizable childwindow in silverlight 3? Any pointers are highly appreciated.

like image 686
funwithcoding Avatar asked Feb 27 '23 13:02

funwithcoding


1 Answers

I don't have any actual code for you, but you would probably want to subclass ChildWindow and handle the MouseLeftButtonDown, MouseMove, and MouseLeftButtonUp mouse events within a certain "border" of the edge of the ChildWindow or within a certain "grip" region (such as the lower-right corner).

You would want to use some standard drag and drop logic to detect that a drag is being performed for a resize and update this.Width and this.Height based on the relative mouse coordinates using the GetPosition() method of the MouseEventArgs class.

You might also want to have a look at the FloatableWindow control on CodePlex, which is a refactored version of the ChildWindow which supports drag and drop moving and resizing.

like image 164
Dan Auclair Avatar answered Mar 02 '23 22:03

Dan Auclair