We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

How to bind Stencil Symbol Source


Hi,

In the following articles

https://help.syncfusion.com/wpf/sfdiagram/stencil

There is an example of creating symbols

But in one of the samples you can find the following code

 <stencil:Stencil.SymbolSource>
                    <local:SymbolCollection>
                        <!--BasicShapes-->
                        <local:NodeVm UnitWidth="60" UnitHeight="60" 
                                      Shape="{StaticResource Rectangle}" Key="Basic Shapes">
                        </local:NodeVm>
                    </local:SymbolCollection>
                </stencil:Stencil.SymbolSource>

NodeVm doesnot implmement ISymbol as mentioned in the article

How can i bind SymbolSource  to a collection of NodeVM from my view model?

Thanks in advance

Tomer

4 Replies

KR Keerthivasan Ramamoorthy Syncfusion Team September 2, 2016 01:07 PM UTC

Hi Tomer, 
 
We have deprecated the ISymbol dependency with SymbolSource and Stencil , in order to provide support to add Node and Connector into Stencil. We have Provided the sample and online documentation link. Please refer to sample and documentation link as below.  
  
Sample Link:125666_Stencil
 
 
 
 
 
Regards, 
Keerthivasan R 



TO tomer September 2, 2016 01:32 PM UTC



Thanks

But i dont see binding here

I was talking about something like

<stencil:Stencil x:Name="stencil"
                             SymbolSource="{Binding Shapes}"

Where the Shapes is a property in my view model of type ObservableCollection<NodeViewModel>

I have tried it and it throw exception

Thanks in advance

Tomer



KR Keerthivasan Ramamoorthy Syncfusion Team September 5, 2016 12:29 PM UTC

Hi Tomer, 
 
We have analyzed and modified a sample. Please refer to a sample from the following link.  
 
 
Sample details: 
In this sample, the SymbolCollection(ObservableCollection<NodeViewModel>) is bind to SymbolSource in Xaml. 
 
Note: 
If the provided information does not address the reported, please revert with your sample that helps us to give the quick solution to you. 
 
Regards, 
Keerthivasan R.   



TO tomer September 5, 2016 02:48 PM UTC


Can you try to bind it to a view model property?

On my side i get null exception

Thanks in advance

Tomer

Loader.
Up arrow icon