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.
Unfortunately, activation email could not send to your email. Please try again.

How to bind Stencil Symbol Source

Thread ID:

Created:

Updated:

Platform:

Replies:

125666 Sep 1,2016 03:57 AM Sep 5,2016 10:48 AM WPF 4
loading
Tags: SfDiagram
tomer
Asked On September 1, 2016 03:57 AM


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

Keerthivasan Ramamoorthy [Syncfusion]
Replied On September 2, 2016 09:07 AM

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 


tomer
Replied On September 2, 2016 09:32 AM



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


Keerthivasan Ramamoorthy [Syncfusion]
Replied On September 5, 2016 08:29 AM

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.   


tomer
Replied On September 5, 2016 10:48 AM


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

On my side i get null exception

Thanks in advance

Tomer

CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;