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.

Inserting text into a SymbolPaletteItem

Thread ID:

Created:

Updated:

Platform:

Replies:

95084 Jun 20,2010 02:38 AM Jun 21,2010 03:10 PM WPF 1
loading
Tags: Diagram
Administrator [Syncfusion]
Asked On June 20, 2010 02:38 AM

This is related to my other question. How do I insert text inside a symbol palette item in the symbol palette toolbox on the side? I am generating the items in that palette programmatically and I want to have a caption on each to label each diagram shape as to what it is.

Jegan R [Syncfusion]
Replied On June 21, 2010 03:10 PM

Hi Michael,

Thanks for your interest in Syncfusion products.

Regarding adding text inside symbol palette item, Symbol palette items can contain any UIElement as its content, provided they must be serializable. A sample has been created please refer the sample form the following link.

Sample Link: http://www.syncfusion.com/uploads/redirect.aspx?&team=support&file=DiagramSample162235718.zip

To add a text in Symbol palette item, please create a grid and add the required content as its children, along with it create a TextBlock with the required text and added it into Grid’s Children. Now assign this Grid as SymbolPaletteItems Content as shown in the following Code Snippet.

Code Snippet:

//new Symbol palette item
SymbolPaletteItem symbolPaletteItem = new SymbolPaletteItem();
//Content for SymbolPaletteItem
System.Windows.Shapes.Path path = this.Resources["CustomShape"] as System.Windows.Shapes.Path;
Grid g = new Grid();
//Text content for SymbolPaletteITem
TextBlock test = new TextBlock() { Text = "Text", HorizontalAlignment=HorizontalAlignment.Center,VerticalAlignment=VerticalAlignment.Center};
//Add both the contents as grid's children
g.Children.Add(path);
g.Children.Add(test);
//Assign the grid as the SymbolPaletteItems' content.
symbolPaletteItem.Content = g;


Please let us know if there are any concerns.

Regards,
Jegan

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.

;