Selection changed event

SyntaxEditor for WPF Forum

Posted 13 years ago by James Deadman
Version: 11.1.0542
Avatar
Hi,

I would like ask about the selection changed event please. I have a control that contains Syntax Editor, and would like to register with its selection-changed event. I noticed the event is based on the view rather than the Syntax Editor object itself.

So two questions please:

1)
How to register with this event - i guess its a case of:
mySyntaxEditor.ActiveView.SelectionChanged += new EventHandler<EditorViewSelectionEventArgs>(this.OnViewSelectionChanged);

Would that be the typical method, or is there a better way?

2) If there is a 4-way split, how to register only with the active view as im only interested in the selection changes of the active pane of the splitter?

If the only way is to register with all views, then how would i know which view the selection has changed within when the handler is called, and how would i register for all views within the splitter as im unsure when they will be split/unsplit?

Thanks!
James

Comments (2)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi James,

1) There is a SyntaxEditor.ViewSelectionChanged event that fires for all the views. You'd want to use that instead.

2) If you only care about the active view, look at the view specified in the event args and see if its IsActive is true.


Actipro Software Support

Posted 13 years ago by James Deadman
Avatar
Thanks very much for your help!

Regards,
James
The latest build of this product (v24.1.2) was released 8 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.