bool ICommand.CanExecute(object parameter) { var ctx = CreateContext(); return(ctx != null && command.IsVisible(ctx) && command.IsEnabled(ctx)); }