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.

Change the image for Connector on SymbolPalette

Thread ID:

Created:

Updated:

Platform:

Replies:

83738 Jun 26,2009 08:27 PM Jun 29,2009 07:07 AM WPF 1
loading
Tags: Diagram
Kevin Ashley
Asked On June 26, 2009 08:27 PM

Can I change the shape of connector in the SymbolPalette? Say, I want to make it any bitmap?

Nikhil A [Syncfusion]
Replied On June 29, 2009 07:07 AM

Hi Kevin,

Thanks for your interest in Syncfusion products.

Yes the shape of the connector in the palette can be changed to whatever you want.

It can be done in the following way:

As the Connector is the second group in the palette, we can access the group using the SymbolGroups[int index] property of SymbolPalette, and then the corresponding item can be accessed in the same way by using the Items[int index] property of SymbolPaletteGroup.

Code Snippet:
BitmapImage bi = new BitmapImage();
bi.BeginInit();
bi.UriSource = new Uri(@"D:\Images\ortho.png", UriKind.RelativeOrAbsolute);
bi.EndInit();
Image i = new Image();
i.Source = bi;

((diagramControl.SymbolPalette.SymbolGroups[1] as SymbolPaletteGroup).Items[0] as SymbolPaletteItem).Content = i;

The above line specifies the content of the first item(index 0)of the second group (index 1, "Connectors") of the SymbolPalette.

In this way the corresponding item of the group can be accessed and the content can be changed.

Please let us know if you have any questions.

Regards,
Nikhil

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.

;