4

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

funwithcoding
  • 2,412
  • 2
  • 30
  • 41

2 Answers2

6

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
  • 3,607
  • 25
  • 32
2

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
  • 411
  • 1
  • 3
  • 9