More complex geometry from code

3 posts, 1 answers
  1. David
    David avatar
    4 posts
    Member since:
    Jul 2013

    Posted 17 Jul 2013 Link to this post

    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. Answer
    Zarko
    Admin
    Zarko avatar
    755 posts

    Posted 17 Jul 2013 Link to this post

    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 >>
  3. UI for WPF is Visual Studio 2017 Ready
  4. David
    David avatar
    4 posts
    Member since:
    Jul 2013

    Posted 18 Jul 2013 Link to this post

    Thanks a lot Zarko, great idea, i'll give it a try !!
    David
Back to Top