private void SetKeyboard()
{
if (KeyboardType == UIKeyboardType.Default)
{
var typeCode = Convert.GetTypeCode(DataContext.UnconvertedValue);
switch (typeCode)
{
case TypeCode.Decimal :
KeyboardType = UIKeyboardType.DecimalPad;
break;
case TypeCode.Double :
KeyboardType = UIKeyboardType.DecimalPad;
break;
case TypeCode.Single :
KeyboardType = UIKeyboardType.DecimalPad;
break;
case TypeCode.Int16 :
KeyboardType = UIKeyboardType.NumberPad;
break;
case TypeCode.Int32 :
KeyboardType = UIKeyboardType.NumberPad;
break;
case TypeCode.Int64 :
KeyboardType = UIKeyboardType.NumberPad;
break;
case TypeCode.UInt16 :
KeyboardType = UIKeyboardType.NumberPad;
break;
case TypeCode.UInt32 :
KeyboardType = UIKeyboardType.NumberPad;
break;
case TypeCode.UInt64 :
KeyboardType = UIKeyboardType.NumberPad;
break;
case TypeCode.DateTime :
KeyboardType = UIKeyboardType.NumbersAndPunctuation;
break;
default:
KeyboardType = UIKeyboardType.Default;
break;
}
}
}
}