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. (Last updated on : Nov 16th 2018).
Unfortunately, activation email could not send to your email. Please try again.
Syncfusion Feedback

To get the base Node interface while dropping symbol

Thread ID:

Created:

Updated:

Platform:

Replies:

124969 Jul 11,2016 07:16 PM UTC Jul 18,2016 12:45 PM UTC WPF 5
loading
Tags: SfDiagram
Alex
Asked On July 11, 2016 07:16 PM UTC

Hello! I use this article to get the base Node interface: https://www.syncfusion.com/kb/5880/how-to-get-the-base-node-interface-while-dropping-a-symbol-from-the-stencil-to-the-sfdiagram.
But despite despite the fact that I put some object into key:
          SymbolItem item = new SymbolItem();          
            NodeViewModel node = new NodeViewModel()        
            {
               ...
                Key = content
            };         
            item.Symbol = node;
            ((SymbolCollection)stencil.SymbolSource).Add(item);
I don't have an acces to it while dropping this symbol to the SfDiagram. It always is null (dropedItem.Key ==null). Another properties of the node are null too. Could you help me?

Keerthivasan Ramamoorthy [Syncfusion]
Replied On July 12, 2016 09:07 AM UTC

 Hi Alex,  
  
 
Reported issue:” Key property became a null while dropping stencil on to the Diagram”.   
  
The reported issue has been already fixed and this fix were included in our volume 2, 2016 release. So please upgrade to the latest version to get the issue resolved. Please download the latest version from the below link. 
 
  
Regards, 
Keerthivasan R. 


Alex
Replied On July 12, 2016 07:10 PM UTC

Hi! I installed the new version. I have two versions of syncfusion.sfdiagram.wpf: 14.2400.0.26 and 14.2450.0.26 now (by the way, why did it happened?). But it does't work  with none of them either.

Attachment: DroppedNode_a6935929.rar

Keerthivasan Ramamoorthy [Syncfusion]
Replied On July 13, 2016 03:21 PM UTC

Hi Alex, 
 
We have analyzed your sample and this is a sample side issue. In sample, the width, height, shape, shape style and Binding style cannot be specified to the NodeViewModel that is the cause of the issue. Now, we have modified the sample as per your requirement.  Please refer to the below sample link. 
 
Sample link:DroppedNode_Modified
 
 
Note: 
Please refer to the below link to know more about usage of Binding style. 
 
Regards, 
Keerthivasan R.  


Alex
Replied On July 13, 2016 04:40 PM UTC

Hello. But here:
 void MainWindow_ItemAdded(object sender, ItemAddedEventArgs args)
        {
            if (args.ItemSource == ItemSource.Stencil)
            {
                var dropedItem = args.Item as NodeViewModel;
                ///----------here I want to get "MyKeyObject"
                var d = dropedItem.Key; // is null
                if (dropedItem != null)
                {
                    INodePort port1 = addPort(dropedItem, 0.5, 0.5);
                    dropedItem.Ports = new ObservableCollection<INodePort>()
                         {
                            port1
                         };
                }
            }
        }
dropedItem.Key == null in your example too.
However I created symbols this way:
             NodeViewModel node = new NodeViewModel()
            {
                Key="MyKeyObject"...
                


Keerthivasan Ramamoorthy [Syncfusion]
Replied On July 18, 2016 12:45 PM UTC

Hi Alex, 
 
Sorry for the inconvenience caused. 
 
We have deprecated the ISymbol dependency with Stencil, in order to provide support to add Node and Connector into Stencil. The Dependent Filter also updated with ISymbol dependency in Volume 1 2016 release. Based on the new API changes, we have modified the sample . Please refer to the below sample link. 
 
Sample Link:DroppedNode_Modified
 
 
Note: 
API changed: 
1)ISymbol->object, 
2)Filter->SymbolFilter 
symbolstencil.SelectedFilter = new SymbolFilterProvider() { SymbolFilter = Filter }; 
 
private bool Filter(SymbolFilterProvider sender, object symbol) 
{ 
return true; 
} 
 
Here, 
Symbolstencil is  instance of Stencil. 
 
 
 
Regards, 
Keerthivasan R. 

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.

Warning Icon 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.Close Icon

;