Closed nrvllrgrs closed 8 years ago
Thank you for reporting this. I can reproduce the problem in the latest release. It looks like this sample app never marks its document as "dirty" (modified) which is why the File -> Save menu command and the toolstrip icon are disabled. That's another mystery and maybe a separate bug as to why Ctrl+S still works! I'll look into this more tomorrow.
I checked in a fix. Thanks again for reporting this.
The sample app had overridden the Dirty property in the base class DomDocument, but did not call the base class's OnDirtyChanged() when the Dirty property was changing. So, the DirtyChanged event wasn't being raised which eventually caused CommandService to not enable the Save command. Ctrl+S still worked because keyboard shortcuts cause the CommandService to double-check if the ICommandClient could do the command. The fix was to simplify the code -- there was no need to override the Dirty property; instead this sample app just needed to listen to the EditingContext's DirtyChanged event and update the document's dirty flag accordingly.
In the DomTreeEditor sample project (release 3.9.0), the Save button in the menu or toolbar does not become enabled. Although, one can still use Ctrl + S to save.