I’m using the regular CommandHandler, not a custom one. I’m also using GoXam for Silverlight v1.2.2 with Silverlight 4. What I’m seeing is that CanIncreaseZoom and CanDecreaseZoom always return the same value once the diagram has been initialized. This issue manifests in two ways:
-
If a Diagram is created with a control template that specifies a value for DiagramPanel.MinimumScale and the value of Diagram.InitialScale has an equal value, then CanDecreaseZoom will always return false. User interface elements that should initially be disabled never get a chance to enable.
-
If a Diagram is created with a control template that specifies a value for DiagramPanel.MinimumScale and the value of Diagram.InitialScale has a greater value, then CanDecreaseZoom will always return true. Calling DecreaseZoomCommand.Execute thankfully does not decrease the DiagramPanel.Scale past the minimum value, but user interface elements remain enabled when they should disable.
The crux of the problem seems to be that the implementation of CommandHandler.ZoomCoomand never fires the ICommand.CanExecuteChanged event.
I assume I’m going to have this problem with all of the other ICommands on CommandHandler. This seems like a serious bug.