private void Step_Unloaded(object sender, RoutedEventArgs e) { AdornerLayer layer = AdornerLayer.GetAdornerLayer(this); if (layer != null) { if (this.MoveChrome != null) { layer.Remove(this.MoveChrome); this.MoveChrome = null; } if (this.ResizedChrome != null) { layer.Remove(this.ResizedChrome); this.ResizedChrome = null; } } }
private void ShowMovedChrome() { if (this.MoveChrome == null) { AdornerLayer layer = AdornerLayer.GetAdornerLayer(this); if (layer != null) { this.MoveChrome = new StepMoveAdorner(this); layer.Add(this.MoveChrome); if (this.IsMoved) { this.MoveChrome.Visibility = System.Windows.Visibility.Visible; } else { this.MoveChrome.Visibility = System.Windows.Visibility.Collapsed; } } } else { this.MoveChrome.Visibility = System.Windows.Visibility.Visible; } }