private static void CheckEnableDisable(BindingListener listener) { if (listener == null) { return; } var thisObject = listener.Context as EventToCommand; if (thisObject != null) { thisObject.EnableDisableElement(); } }
/// <summary> /// Initializes a new instance of the EventToCommand class. /// </summary> public EventToCommand() { _listenerCommand = new BindingListener( this, (s, e) => { var sender = s as BindingListener; if (sender != null) { OnCommandChanged( sender.Context as EventToCommand, e.EventArgs); } }); _listenerParameter = new BindingListener( this, (s, e) => CheckEnableDisable(s as BindingListener)); _listenerToggle = new BindingListener( this, (s, e) => CheckEnableDisable(s as BindingListener)); }