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

No connectors is showing

2 Answers 104 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Mattias
Top achievements
Rank 1
Mattias asked on 04 Apr 2012, 01:14 PM
public class PrimitiveShape : RadDiagramShapeBase
{
    public PrimitiveShape() : base()
    {
        this.DefaultStyleKey = typeof(PrimitiveShape);
         
    }
}
<ResourceDictionary
    xmlns:local="clr-namespace:GSAB.RSProduction.Modules.OfficeTools.ViewModel.Workflow">
 
    <Style TargetType="local:PrimitiveShape">
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:PrimitiveShape">
                    <Border Background="{TemplateBinding Background}"
                            BorderBrush="{TemplateBinding BorderBrush}"
                            BorderThickness="{TemplateBinding BorderThickness}">
                         
                        <telerik:RadDiagramShape Geometry="{telerik:CommonShape ShapeType=OctagonShape}" />
                     
                    </Border>
 
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
</ResourceDictionary>
I'm trying to implement a simple primitive shape by inheriting from RadDiagramShapeBase, but when adding it to the diagram no connectors is showing. Any suggestions on what I'm doing wrong here would be appreciated.

2 Answers, 1 is accepted

Sort by
0
Mattias
Top achievements
Rank 1
answered on 04 Apr 2012, 02:19 PM
Fount it, added the following part from the theme to my controltemplate:

<ItemsControl x:Name="ConnectorsAdorner"
                                   ItemsSource="{Binding RelativeSource={RelativeSource TemplatedParent}, Path=ConnectorPoints}"
                                   Visibility="Collapsed"
                    >
                           <ItemsControl.ItemsPanel>
                               <ItemsPanelTemplate>
                                   <primitives:ConnectorsPanel />
                               </ItemsPanelTemplate>
                           </ItemsControl.ItemsPanel>
                       </ItemsControl>
0
Alex Fidanov
Telerik team
answered on 05 Apr 2012, 11:42 AM
Hi,

 Could you please give us more information on what you are trying to achieve? Are you inheriting the base RadDiagramShape class to extend its funcionality or to have a different look and feel? If it is the latter, then you can just change the default template or content template, without subclassing it. Moreover, in the inherited shape's template you should not be using the original shape. I would recommend using the default shape style as a base for your custom one. The default styles we are shipping in the installation directory. Its full path should look something like this : C:\Program Files (x86)\Telerik\RadControls for Silverlight Q1 2012\Themes\Metro\Themes\Metro\DiagramShapes.xaml

All the best,
Alex Fidanov
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Tags
Diagram
Asked by
Mattias
Top achievements
Rank 1
Answers by
Mattias
Top achievements
Rank 1
Alex Fidanov
Telerik team
Share this question
or