c# - Accessing data from an Adorner -
i'm writing 2d graphics tool in c# , wpf, , i'm using adorners
on shapes
drawn canvas
.
i'd adorners highlight when shape considered "selected", i'm doing using mousedown
, mouseup
events.
however, user can select multiple shapes, not of shapes receive both of mouse events.
i have class manages drawing, holds list
of selected shapes. best way give adorners access data, can see if adorned element selected?
some thing's i've considered:
- making
list
global - bad idea - sub-classing each shape add "selected" property - require changing references shapes in class
you can make attached dependencyproperty set on shape - can set property when select one. adorner can have visibility binding property on shape visibility set automatic.
you can use tag property on shape store values - old way of doing :)
Comments
Post a Comment