David
David

Reputation: 171

Add a custom local property to a control?

I've found this code which allows dragging a control around a canvas.

What is the way to add this draggable property programmatically to a control that's created in C#?

Upvotes: 0

Views: 33

Answers (1)

Chris Mack
Chris Mack

Reputation: 5208

You can set it like this, for example:

Button b = new Button();

b.SetValue(DraggableExtender.CanDragProperty, true);

Upvotes: 1

Related Questions