-1

I'm trying to clone UIElement. Everything seems to be ok, but my DependencyProperties also copy to a new element as in:

var newEl = new MyElement();

And because one of my DependencyProperties is also a UIElement and it's already bound onto window error occurs that element is already in use. So I even can't create new element.

What is the problem?

Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
Artem Makarov
  • 874
  • 3
  • 14
  • 25

1 Answers1

0

Ok, the only solving that I've found is to remove DependencyProperty and create a normal Property for my ObservateCollection<UIElement> and use INotifyPropertyChanged.

Dave Clemmer
  • 3,741
  • 12
  • 49
  • 72
Artem Makarov
  • 874
  • 3
  • 14
  • 25