Removed some unnecessary calls to CanExecute

This commit is contained in:
Laurent Bugnion 2016-04-20 23:40:48 +02:00
Родитель 48064a528d
Коммит 8e3ec926fe
1 изменённых файлов: 2 добавлений и 12 удалений

Просмотреть файл

@ -324,11 +324,7 @@ namespace GalaSoft.MvvmLight.Helpers
EventHandler<TEventArgs> handler = (s, args) =>
{
var param = castedBinding == null ? default(T) : castedBinding.Value;
if (command.CanExecute(param))
{
command.Execute(param);
}
command.Execute(param);
};
e.AddEventHandler(
@ -484,13 +480,7 @@ namespace GalaSoft.MvvmLight.Helpers
var t = element.GetType();
var e = t.GetEventInfoForControl(eventName);
EventHandler<TEventArgs> handler = (s, args) =>
{
if (command.CanExecute(commandParameter))
{
command.Execute(commandParameter);
}
};
EventHandler<TEventArgs> handler = (s, args) => command.Execute(commandParameter);
e.AddEventHandler(
element,