1

Topic: Data output on mouse click

There is base class ShapeVM. There are 3 derivative classes CircleVM, LineVM, ArcVM. In class MainWindowVM it is formed ObservableCollection <ShapeVM> of figures of derivative classes. After that on Canvas  these figures.

<ItemsControl. ItemTemplateSelector>
<local2:ShapeTemplateSelector>
<local2:ShapeTemplateSelector.CircleTemplate>
<DataTemplate>
<Path Stroke = "Black">
<Path. Data>
<EllipseGeometry Center = "{Binding Center, Mode=OneWay}" RadiusX = "{Binding Radius}" RadiusY = "{Binding Radius}">
</EllipseGeometry>
</Path. Data>
</Path>
</DataTemplate>
</local2:ShapeTemplateSelector.CircleTemplate>

Each figure has also field Text. It is required to display this field on mouse click on a figure. How it can be implemented?

2

Re: Data output on mouse click

If a dial-up of geometries fixed it is possible to make ContentControl In which contents over set Shape' or Path' will be displayed. This ContentControl to place in DataTemplate