Nevron Forum

When selecting a node in the diagram, text disaapears

https://www.nevron.com/Forum/Topic3679.aspx

By yoav Roytenberg - Tuesday, June 15, 2010

I have a diagram, where some of the nodes background color is red.
When I select a node with a red background color, the text disappears.
I saw that whenever selecting a node, the shape text color is painted red.
Can this be modified?
By Nevron Support - Tuesday, June 15, 2010

There are many ways to do this. Take a look at the view.InteractivityManager. For example you can set the ChangeSelectedText property of the interactivity manager to false. Another possible solutions are to change the SelectedStrokeStyle or the SelectedAppearanceChange.

By Jérôme Bouche - Tuesday, November 23, 2010

Hi, to set the SelectedStrokeStyle property of a view, we do :

NStrokeStyle nst = new NStrokeStyle(Color.Red);
nst.Width = new NLength(2);
view.InteractiveAppearance.SelectedStrokeStyle = nst;


I'm trying to set the SelectedStrokeStyle property of a specific node of my View :

//ks is a specialized NNode :
NStrokeStyle nst = new NStrokeStyle(Color.Red);
nst.Width = new NLength(2);
NInteractiveAppearance nia = new NInteractiveAppearance();
nia.SelectedStrokeStyle = nst;
ks.Style.InteractivityStyle = new NInteractivityStyle();
ks.Style.InteractivityStyle.InteractivityAttributes = new NInteractivityAttributeCollection();
ks.Style.InteractivityStyle.InteractivityAttributes.Add(nst);

But that not works, how can I set the "InteractiveAppearance -> SelectedStrokeStyle" of only one Node ?
By Nevron Support - Wednesday, November 24, 2010

Hi, to change the stroke style of a single node when selected you can subscribe to the NodeSelected (change the stroke style there) and NodeDeselected (restore the stroke style there) events of the drawing view's event sink service. Note that you should also change the selected appearance change mode of the view, so that it does not change the stroke style of the selected node:

view.InteractiveAppearance.SelectedAppearanceChangeMode = AppearanceChangeMode.None;

By Jérôme Bouche - Thursday, November 25, 2010

Thx