Phil Trelford's Array
POKE 36879, 255

Silverlight 5: Floating Windows (WIP)

March 6, 2012 15:19 by phil

The first stable release of the Silverlight 5 Multi-Window Controls project is now available on CodePlex which brings external window support to the ChildWindow and ContextMenu.

So what’s next if anything?

I came across Tim Heur’s Silverlight FloatableWindow project on CodePlex, that adapts the ChildWindow control for non-modal use, and has attracted over 10,000 downloads!

With Silverlight 5 it should be possible to have floating windows that in desktop mode (also known as out-of-browser or OOB mode) can be dragged in and out of the main window.

I started off with Jeff Blackenburg’s Silverlight drag and drop sample, from day 5 of the 31 days of Silverlight series, which lets you move coloured shapes around the main window. Tracing the mouse move coordinates when a drag operation escaped the main window showed that even though the captured object was left behind the x,y coordinates updated. Therefore all that was needed to drag out was to create a new external window when the drag operation begins and move the window as the mouse moves. Then if the drag operation ends inside the main window the external window can be discarded otherwise it should take ownership of the dragged control.

That worked so I updated the prototype to handle simple windows instead of shapes. To see it in it’s full glory you will need to right click on the Silverlight application below to install it on your desktop where you can drag the floating windows in and out of the main window:


This is a work in progress, so constructive feedback is particularly welcome.

The source is available on BitBucket: https://bitbucket.org/ptrelford/floaters

Once I’m happy with usability I plan to integrate it into the Silverlight Multi-Window Controls project on CodePlex.


Tags:
Categories: Silverlight | C# | .Net
Actions: E-mail | Permalink | Comments (1) | Comment RSSRSS comment feed

Comments

March 13. 2013 02:30

Nirav

Hello Thanks for the article,

Now i am facing one problem is that how to close the off screen floating window?

for duplicate, just click on New Window and drag this window to upside(off screen) and try to drag this in downward direction.It doesn't allow you to do this.

so please help me regarding this

Nirav

Add comment


(Will show your Gravatar icon)

  Country flag

biuquote
  • Comment
  • Preview
Loading