The Syncfusion native Blazor components library offers 70+ UI and Data Viz web controls that are responsive and lightweight for building modern web apps.
.NET PDF framework is a high-performance and comprehensive library used to create, read, merge, split, secure, edit, view, and review PDF files in C#/VB.NET.
Hi,
I want to be notified when a symbol label is changed. In order to do that I''ve make a class of mine inherited from symbol label and defined OnPropertyChangeEvent (and listening for the text property).
The problem is that when I click now on a symbol it doesn''t let me change the text (and I''ve readonly set to false). (In some cases I can but I''ve to give a lot of clicks...It seems it selects the symbol and not the label, has something to do with bounds...)
This is my code now:
VDILabel vdiLabel = new VDILabel(this);
AddLabel(vdiLabel);
This is the previous code:
Syncfusion.Windows.Forms.Diagram.Label lbl = this.AddLabel("Not defined yet", BoxPosition.Center);
It should be exactly the same thing, no?
Regards,
Jose Santos
ADAdministrator Syncfusion Team February 18, 2005 09:50 PM UTC
Hi Jose,
I will have to take a look at your SymbolLabel subclass and your implementation to determine the problem. I tried using a subclassed SymbolLabel type in the DynamicSymbol sample and the editing works as expected. The following is the code that I used,
CustomSymbolLabel lbl = new CustomSymbolLabel();
this.AddLabel(lbl);
lbl.Text = "Hello World";
lbl.Anchor = BoxPosition.Center;
lbl.BackgroundStyle.Color = Color.Transparent;
Please try to attach a small sample that shows the problem and I will take a look at it.
But I am curious about why you require a subclass of the SymbolLabel to be notified of changes to the label text. All that is required is for you to handle the Diagram.Model.PropertyChanging/PropertyChanged events and examine whether the Node undergoing the change is a SymbolLabel and the property being changed is its ''Text''. The PropertyEventArgs will get you the new and old values of the text, and the SymbolLabel''s Container should fetch you the Symbol that is hosting the label.
Regards,
Prakash
Syncfusion, Inc