views:

1057

answers:

2

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

+1  A: 

Take a look at Tim Huer's FloatableWindow. I think this might do what you are looking for.

http://timheuer.com/blog/archive/2009/07/08/silverlight-floatablewindow-updated-with-resizing-capabilities.aspx

Mike
+3  A: 

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.

Dan Auclair
nicely put... +1
almog.ori