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:
Родитель
8e3ec926fe
Коммит
e289bfaa29
|
@ -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;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче