CK.WindowManager.WindowAutoBinder.OnWindowMoved C# (CSharp) Method

OnWindowMoved() public method

public OnWindowMoved ( object sender, WindowElementLocationEventArgs e ) : void
sender object
e CK.WindowManager.Model.WindowElementLocationEventArgs
return void
        void OnWindowMoved( object sender, WindowElementLocationEventArgs e )
        {
            Debug.Assert( Dispatcher.CurrentDispatcher == Application.Current.Dispatcher, "This method should only be called by the Application Thread." );

            //avoids bind during a resize
            if( !_resizeMoveLock && !_pointerDownLock )
            {
                if( _tester.CanTest )
                {
                    ISpatialBinding binding = WindowBinder.GetBinding( e.Window );
                    IDictionary<IWindowElement, Rect> rect = WindowManager.WindowElements.ToDictionary( x => x, y => WindowManager.GetClientArea( y ) );

                    IBinding result = _tester.Test( binding, rect, AttractionRadius );
                    if( result != null )
                    {
                        _bindResult = WindowBinder.PreviewBind( result.Target, result.Origin, result.Position );
                    }
                    else
                    {
                        if( _tester.LastResult != null )
                        {
                            WindowBinder.PreviewUnbind( _tester.LastResult.Target, _tester.LastResult.Origin );
                            _bindResult = null;
                        }
                    }
                }
            }
            _resizeMoveLock = false;
        }