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

Stroke, StrokeThickness binding doesn't work

1 Answer 216 Views
Diagram
This is a migrated thread and some comments may be shown as answers.
nicolasf
Top achievements
Rank 2
nicolasf asked on 28 Jun 2017, 11:53 AM

Hi,

 

I try to bind Stroke, strokeThickness and StrokeDashArray properties. I try manually and with ItemInformationAdorner.AdditionalContent but that's doesn't work.

Can you help me pls ?

This is my code

<telerik:RadDiagram Position="0,0" x:Name="tlrDiagram" ContainerShapeStyle="{StaticResource entityStyle}">
                <telerik:EventToCommandBehavior.EventBindings>
                    <telerik:EventBinding Command="{Binding ItemsChangingCommand}" EventName="ItemsChanging" RaiseOnHandledEvents="True" PassEventArgsToCommand="True" />
                </telerik:EventToCommandBehavior.EventBindings>
                <telerik:RadDiagramContainerShape x:Name="src" Width="50" Height="50" Position="10,10" BorderThickness="0"   StrokeThickness="3" StrokeDashArray="1" Stroke="Red" />
                <telerik:RadDiagramContainerShape x:Name="dest"  Width="50" Height="50" Position="150,150" Stroke="blue" StrokeThickness="3" StrokeDashArray="1" />
                <telerik:RadDiagramConnection Source="{Binding ElementName=src}" Target="{Binding ElementName=dest}" Stroke="GreenYellow" StrokeThickness="3" StrokeDashArray="1" />
                <primitives:ItemInformationAdorner.AdditionalContent>
                    <telerik:SettingsPane Diagram="{Binding ElementName=tlrDiagram}" />
                </primitives:ItemInformationAdorner.AdditionalContent>
            </telerik:RadDiagram>

 

 

 

<Style x:Key="entityStyle" TargetType="telerik:RadDiagramContainerShape">
       <Setter Property="IsEditable" Value="True" />
       <Setter Property="IsResizingEnabled" Value="False" />
       <Setter Property="HorizontalContentAlignment" Value="Center" />
       <Setter Property="VerticalContentAlignment" Value="Center" />
       <Setter Property="IsConnectorsManipulationEnabled" Value="False" />
       <Setter Property="IsCollapsible" Value="false" />
       <Setter Property="Padding" Value="0" />
       <Setter Property="IsCollapsed" Value="false" />
       <Setter Property="Background" Value="DimGray" />
       <Setter Property="Foreground" Value="Black" />
       <Setter Property="BorderBrush" Value="White" />
       <Setter Property="BorderThickness" Value="1" />
       <Setter Property="FontFamily" Value="Segoe UI" />
       <Setter Property="Width" Value="250" />
       <Setter Property="Margin" Value="0" />
       <Setter Property="Effect">
           <Setter.Value>
               <DropShadowEffect BlurRadius="15"
                                 Direction="-90"
                                 ShadowDepth="2"
                                 RenderingBias="Quality"/>
           </Setter.Value>
       </Setter>
   </Style>

 

 

 

 

1 Answer, 1 is accepted

Sort by
0
Dinko | Tech Support Engineer
Telerik team
answered on 03 Jul 2017, 07:43 AM
Hello ,

Thank you for contacting us.

To bind the Stroke, StrokeThickness, and StrokeDashArray properties of the RadDiagramContainerShape you can extract and edit the default template of the container shape. You can take a look at the Editing Control Templates help article in our documentation which describes how you can extract the control templates of the controls.

Regards,
Dinko
Progress Telerik
Want to extend the target reach of your WPF applications, leveraging iOS, Android, and UWP? Try UI for Xamarin, a suite of polished and feature-rich components for the Xamarin framework, which you to write beautiful native mobile apps using a single shared C# codebase.
Tags
Diagram
Asked by
nicolasf
Top achievements
Rank 2
Answers by
Dinko | Tech Support Engineer
Telerik team
Share this question
or