Window snap to edge

Jun 13 2014 5:04 AM

Hello everyone,

First of all I want to say, that I'm trying to resolve this problem since few days, and believe me I search lot of pages on google, and really nothing:/. For me it's very hard to resolve, becouse my knowledge about C# is still at beginner. But first of all I just think about small feature that will snap my window to edge of screen (for example, when I move window for some small distance from edge (top or right or etc), window will in magnetic way stick to edge of screen). I dont want to make snap do other windows in my applications, or make top on all top, just "only" make dock, snap, magnet, or whatever, to edge screen. In first moment, I thought, that it will be not so complex, but after I search google, there is really no such solutions in simply way://. Moreover, the only solution which work and it's really fine, I have found (really, this is only code that really work, on all gooooogle:)) - is written in VB.

I tried to rewrite it for C#, but unfortunatell, I'm doing WPF app, that's why there sooo much incosistency that I really cannot fight with this:// 5 days and still nothing:/. I know that I'm asking for much, I know, but I really don't have any solution, how make WPF to work with this.

Only solution like I wrote is here (VB):

http://www.codeproject.com/Articles/15314/A-NET-Snap-To-Screen-Form

Can somebody try help me somehow?

Thanks even for read this!;)