void Capture_IsCapturingChanged(object sender, EventArgs e) { if (this.ViewModel.Capture.IsCapturing) { var interior = new Rect(this.ModelView.ActualWidth * 0.1, this.ModelView.ActualHeight * 0.1, this.ModelView.ActualWidth * 0.8, this.ModelView.ActualHeight * 0.8); var adornerLayer = AdornerLayer.GetAdornerLayer(this.ModelView); _croppingAdorner = new CroppingAdorner(this.ModelView, interior); _croppingAdorner.Fill = new SolidColorBrush(Color.FromArgb(0xC0, 0, 0, 0)); _croppingAdorner.SetBinding(CroppingAdorner.ClippingRectangleProperty, new Binding("ClippingRectangle") { Source = this.ViewModel.Capture, Mode = BindingMode.TwoWay }); _croppingAdorner.SetBinding(CroppingAdorner.MinimumClippingWidthProperty, new Binding("MinimumClippingWidth") { Source = this.ViewModel.Capture }); _croppingAdorner.SetBinding(CroppingAdorner.MinimumClippingHeightProperty, new Binding("MinimumClippingHeight") { Source = this.ViewModel.Capture }); _croppingAdorner.SetBinding(CroppingAdorner.IsResizeEnabledProperty, new Binding("IsResizeEnabled") { Source = this.ViewModel.Capture }); _croppingAdorner.SetBinding(CroppingAdorner.UniformScaleProperty, new Binding("IsOutputSizeLocked") { Source = this.ViewModel.Capture }); adornerLayer.Add(_croppingAdorner); } else { var adornerLayer = AdornerLayer.GetAdornerLayer(this.ModelView); adornerLayer.Remove(_croppingAdorner); } }