icsharpcode / WpfDesigner

The WPF Designer from SharpDevelop
MIT License
958 stars 259 forks source link

Changed event #39

Closed mnusr closed 6 years ago

mnusr commented 7 years ago

Does the designer have any event that will fire when any change is made to the designer? I simply want to update my text/code editor as soon as the anything in the designer changes. I've looked and haven't found anything so far.

awraae commented 7 years ago

Hi mnusr. I use the UndoService.UndoStackChanged event for the same purpose.

SomeDesignItem.Services.GetService<UndoService>().UndoStackChanged += ...

mnusr commented 7 years ago

Thanks @awraae, I would've thought there would've been a generic event for this purpose, I guess this will have to do just now.

awraae commented 7 years ago

Anytime @mnusr. I had the same feeling at first. But when you think about it: every change to the DesignItem model is executed through the UndoService. So I actually think that this is the “generic event" you are looking for.