Added UITextField and UISwitch as UI elements that are recognized by

the SetCommand and by the Binding class for their default event.
This commit is contained in:
Laurent Bugnion 2016-04-20 23:43:52 +02:00
Родитель 8e3ec926fe
Коммит e289bfaa29
2 изменённых файлов: 21 добавлений и 0 удалений

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

@ -137,6 +137,14 @@ namespace GalaSoft.MvvmLight.Helpers
return binding;
}
var textField = _propertySource.Target as UITextField;
if (textField != null)
{
var binding = ObserveSourceEvent("EditingChanged");
binding._sourceHandlers["EditingChanged"].IsDefault = true;
return binding;
}
var checkbox = _propertySource.Target as UISwitch;
if (checkbox != null)
{
@ -163,6 +171,14 @@ namespace GalaSoft.MvvmLight.Helpers
return binding;
}
var textField = _propertyTarget.Target as UITextField;
if (textField != null)
{
var binding = ObserveTargetEvent("EditingChanged");
binding._targetHandlers["EditingChanged"].IsDefault = true;
return binding;
}
var checkbox = _propertyTarget.Target as UISwitch;
if (checkbox != null)
{

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

@ -349,6 +349,11 @@ namespace GalaSoft.MvvmLight.Helpers
{
eventName = "Clicked";
}
else if (type == typeof (UISwitch)
|| typeof (UISwitch).IsAssignableFrom(type))
{
eventName = "ValueChanged";
}
return eventName;
}