Instead using the ConnectionStyleSelector you can define one Style targeting the RadDiagramConnection and bind the properties that you need to change to properties exposed by your ViewModel. In your particular case you need to bind the TargetCapType and the SourceCapType properties of the RadDiagramConnection to your custom properties.
Furthermore, you can subscribe to the PropertyChanged event of your custom link and change the TargetCapType and the SourceCapType properties when the target shape is of type B. You can use similar to this code:
MyLink : LinkViewModelBase<MyNode>
.PropertyChanged += MyLink_PropertyChanged;
sender, System.ComponentModel.PropertyChangedEventArgs e)
//your custom logic goes here
Please give this approach a try and let me know if you need any further assistance.
Pavel R. Pavlov
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 >>