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.

Control / Container Node for WPF / Silverlight

Thread ID:

Created:

Updated:

Platform:

Replies:

96087 Aug 19,2010 02:50 PM Aug 23,2010 08:24 AM ASP.NET Web Forms (Classic) 3
loading
Tags: DiagramWebControl
Andre van Staden
Asked On August 19, 2010 02:50 PM

Hi,

Is there the equivalent of the ControlNode class available for WPF / Silverlight. If not, is it being planned for a later release or should I start rolling my own version ?

Thanks
Andre

Pandi Murugan A [Syncfusion]
Replied On August 21, 2010 02:37 AM

Hi Andre,

Thank you for using Syncfusion Products.

In both WPF and Silverlight, we suggest you to use Syncfusion diagram Node’s Content property to host any control (UIElement) or any content inside a node in the diagram.

Please refer the following code snippet.



private void createNode()
{
Node n = new Node();
n.Shape = Shapes.Default;
Button b = new Button();
b.Content = "Click ME!";
n.Content = b;
(n.Content as Button).IsHitTestVisible = true;
dc.Model.Nodes.Add(n);
b.Click += new RoutedEventHandler(b_Click);
}

void b_Click(object sender, RoutedEventArgs e)
{
MessageBox.Show("i am fired"); // do something here;
}

Here, Button is a UIElement; similarly any UIElement can be hosted as a Node’s Content.



We have created a sample for your reference. Please refer the sample below.

Sample-806541268.zip

Please let me know if you have any concerns.

Regards,
Pandi Murugan A

Andre van Staden
Replied On August 22, 2010 03:57 AM

Thanks a lot,

I was trying this for days without any success. The answer is that I left out the creation of an instance of type Shape and the GUI elements was thus never visible and would never fire.

Thanks for the help - just goes to show that the simple solution (almost always) is the one that works.

Regards
Andre

Pandi Murugan A [Syncfusion]
Replied On August 23, 2010 08:24 AM

Hi Andre,

Thank you for your feedback.

Please get back us if you have any other concerns.

Regards,
Pandi Murugan A

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.

;