protected virtual void OnWindowSizeChanged( object sender, EventArgs e ) { if( Dispatcher.CurrentDispatcher != Application.Current.Dispatcher ) throw new InvalidOperationException( "This method should only be called by the Application Thread." ); IWindowElement windowElementFromSender = sender as IWindowElement; if( windowElementFromSender != null ) { WindowElementData data = null; if( _dic.TryGetValue( windowElementFromSender, out data ) ) { double previousWidth = data.Width; double previousHeight = data.Height; data.UpdateFromWindow(); double deltaWidth = data.Width - previousWidth; double deltaHeight = data.Height - previousHeight; if( deltaWidth != 0 || deltaHeight != 0 ) { var evt = new WindowElementResizeEventArgs( windowElementFromSender, deltaWidth, deltaHeight ); if( WindowResized != null ) WindowResized( sender, evt ); } } } }
void OnWindowManagerWindowResized( object sender, WindowElementResizeEventArgs e ) { Debug.Assert( Dispatcher.CurrentDispatcher == Application.Current.Dispatcher, "This method should only be called by the ExternalThread." ); IWindowElement triggerHolder = e.Window; // Gets all windows attached to the given window ISpatialBinding binding = WindowBinder.GetBinding( triggerHolder ); if( binding != null ) { if( e.DeltaHeight != 0 || e.DeltaWidth != 0 ) { ResizingWindow( binding ); PlacingWindow( binding ); } } }
private void OnWindowManagerWindowResized( object sender, WindowElementResizeEventArgs e ) { HideButtons( e.Window ); }
//avoids bind during a resize void OnWindowResized( object sender, WindowElementResizeEventArgs e ) { Debug.Assert( Dispatcher.CurrentDispatcher == Application.Current.Dispatcher, "This method should only be called by the Application Thread." ); _resizeMoveLock = true; }