From c7df85937f73fb347ee0b19e9c052d2d00a6df6c Mon Sep 17 00:00:00 2001 From: 黄学彪 <hxb@hdlchina.com.cn> Date: 星期五, 18 九月 2020 13:58:19 +0800 Subject: [PATCH] 新版本 --- ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs | 11 +++++++++-- 1 files changed, 9 insertions(+), 2 deletions(-) diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs old mode 100644 new mode 100755 index 72ed6e8..58b1f8c --- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs +++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/BaseCommonControl/Base/TextInputBase.cs @@ -45,6 +45,10 @@ /// </summary> public Action FinishInputEvent = null; /// <summary> + /// 鍊兼敼鍙樹簨浠�(鍙桵axByte灞炴�ч檺鍒�) + /// </summary> + public Action<string> TextChangedEvent = null; + /// <summary> /// 鎸囧畾璇ヨ緭鍏ユ鏄惁涓轰笉鍙渷鐣�(榛樿涓篺alse) /// </summary> public bool MustInput = false; @@ -258,12 +262,13 @@ private void TxtCode_TextChangedEvent(object sender, string value) { var byteData = Encoding.UTF8.GetBytes(value); + var newValue = value; //濡傛灉杈撳叆鐨勫��,宸茬粡澶т簬鎸囧畾鐨刡yte鏁�,鍒欐埅鍙� if (byteData.Length > this.m_MaxByte) { //鎴彇鎸囧畾鐨刡yte瀛楄妭 - var newValue = Encoding.UTF8.GetString(byteData, 0, this.m_MaxByte); + newValue = Encoding.UTF8.GetString(byteData, 0, this.m_MaxByte); //鏈�鍚庝竴浣嶄笉瑕�,鍥犱负鎴彇鐨勬渶鍚庝竴浣嶅彲鑳芥槸涔辩爜 newValue = newValue.Substring(0, newValue.Length - 1); //鎷兼帴涓婂畠鐨勪笅涓�浣�,鐒跺悗妫�娴� @@ -274,11 +279,12 @@ newValue = checkValue; } this.Text = newValue; -#if Android //灏嗗厜鏍囪嚦浜庢渶鍚� +#if Android this.SetSelectionEnd(); #endif } + this.TextChangedEvent?.Invoke(newValue); } #endregion @@ -355,6 +361,7 @@ public override void RemoveFromParent() { this.FinishInputEvent = null; + this.TextChangedEvent = null; if (this.Parent != null) { base.RemoveFromParent(); -- Gitblit v1.8.0