Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/fix property changed event handler deregistration on RenderTransformOriginExtension #108

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@

using System;
using System.ComponentModel;
using System.Threading;
using ICSharpCode.WpfDesign.Adorners;
using ICSharpCode.WpfDesign.Extensions;
using System.Windows.Controls.Primitives;
Expand All @@ -33,8 +34,7 @@ public class RenderTransformOriginExtension : SelectionAdornerProvider
{
readonly AdornerPanel adornerPanel;
RenderTransformOriginThumb renderTransformOriginThumb;
/// <summary>An array containing this.ExtendedItem as only element</summary>
readonly DesignItem[] extendedItemArray = new DesignItem[1];

// IPlacementBehavior resizeBehavior;
// PlacementOperation operation;
// ChangeGroup changeGroup;
Expand Down Expand Up @@ -86,7 +86,6 @@ void renderTransformOriginThumb_DragDelta(object sender, DragDeltaEventArgs e)
protected override void OnInitialized()
{
base.OnInitialized();
extendedItemArray[0] = this.ExtendedItem;
this.ExtendedItem.PropertyChanged += OnPropertyChanged;

if (this.ExtendedItem.Properties.GetProperty(FrameworkElement.RenderTransformOriginProperty).IsSet) {
Expand Down Expand Up @@ -116,6 +115,7 @@ void OnPropertyChanged(object sender, System.ComponentModel.PropertyChangedEvent

protected override void OnRemove()
{
this.ExtendedItem.PropertyChanged -= OnPropertyChanged;
renderTransformOriginPropertyDescriptor.RemoveValueChanged(this.ExtendedItem.Component, OnRenderTransformOriginPropertyChanged);

base.OnRemove();
Expand Down
Loading