This is a migrated thread and some comments may be shown as answers.

More complex geometry from code

2 Answers 116 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
David
Top achievements
Rank 1
David asked on 17 Jul 2013, 07:57 AM
Hi!

We need to make a complex custom shape (please see attached png). It is composed of many different geometries and brushes. Plus, we have to draw it dynamically from code because it should be drawn according to some properties (nb of floors, number of Windows, etc...), so we c'ant use a xaml to describe the shape.

In our current home made diagram control, shapes derive from visualdrawing and we use the drawingcontext in conjunction with GeometryDrawing object.

Now, we are evaluating Telerik diagram control. Would this be possible? How would you achieve this ?

Any infos appreciated, thanks !

David

2 Answers, 1 is accepted

Sort by
0
Accepted
Zarko
Telerik team
answered on 17 Jul 2013, 01:33 PM
Hello David,
You could inherit our RadDiagramShapeBase and use the default template of the RadDiagramShape but instead of a geometry add an Image control like this:
<Image x:Name="NormalContent" Source="{TemplateBinding ImageSource}" />
This way in code behind you could create your DrawingVisual or DrawingGroup create an imageSource from them and directly set it to a custom ImageSource dependency property.
I've attached a sample project so could you please examine it and if you have further questions feel free to ask.

Regards,
Zarko
Telerik
TRY TELERIK'S NEWEST PRODUCT - EQATEC APPLICATION ANALYTICS for WPF.
Learn what features your users use (or don't use) in your application. Know your audience. Target it better. Develop wisely.
Sign up for Free application insights >>
0
David
Top achievements
Rank 1
answered on 18 Jul 2013, 09:10 AM
Thanks a lot Zarko, great idea, i'll give it a try !!
David
Tags
Diagram
Asked by
David
Top achievements
Rank 1
Answers by
Zarko
Telerik team
David
Top achievements
Rank 1
Share this question
or