From 8b9ce384b26c414db32f98e94e088f5334869c2d Mon Sep 17 00:00:00 2001
From: 黄学彪 <hxb@hdlchina.com.cn>
Date: 星期三, 13 十一月 2019 15:36:28 +0800
Subject: [PATCH] 全部合并了代码,安卓和 IOS 都测试通过了

---
 ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/DialogInputForm.cs |   42 ++++++++++++++++--------------------------
 1 files changed, 16 insertions(+), 26 deletions(-)

diff --git a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DialogInputFrameControl.cs b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/DialogInputForm.cs
similarity index 91%
rename from ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DialogInputFrameControl.cs
rename to ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/DialogInputForm.cs
index 2e11d1d..f29c96d 100755
--- a/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Controls/DialogInputFrameControl.cs
+++ b/ZigbeeApp/Shared/Phone/UserCenter/CommonBase/Form/DialogInputForm.cs
@@ -9,7 +9,7 @@
     /// <para>瀛愭帶浠舵坊鍔犲畬鎴愬悗锛岃璋冪敤銆怚nitLastControl銆戝嚱鏁板畬鎴愭渶鍚庣殑鍒濆鍖�(浠呴檺None妯″紡)</para>
     /// <para>纭鎸夐挳鐨勫崟鍑讳簨浠朵负锛欳omfirmClickEvent</para>
     /// </summary>
-    public class DialogInputFrameControl : FrameLayout
+    public class DialogInputForm : DialogCommonForm
     {
         #region 鈻� 鍙橀噺澹版槑___________________________
 
@@ -77,37 +77,20 @@
         /// <para>瀛愭帶浠舵坊鍔犲畬鎴愬悗锛岃璋冪敤銆怓inishInitControl銆戝嚱鏁板畬鎴愭渶鍚庣殑鍒濆鍖�(浠呴檺None妯″紡)</para>
         /// <para>纭鎸夐挳鐨勫崟鍑讳簨浠朵负锛欳omfirmClickEvent</para>
         /// </summary>
-        /// <param name="mainFrame">
-        /// <para>杞戒綋鐖舵帶浠�(浼氳嚜鍔ㄥ皢璇ユ帶浠跺姞鍏ユ杞戒綋鐖舵帶浠�)</para>
-        /// <para>鍙互涓虹┖,褰撲负绌烘椂,璇峰湪娣诲姞鍏ヨ浇浣撶埗鎺т欢鍚�,璋冪敤InitframeControl鍑芥暟杩涜鍒濆鍖�</para>
-        /// </param>
         /// <param name="i_dialogFrameMode">寮圭獥妯″紡</param>
-        public DialogInputFrameControl(FrameLayout mainFrame, DialogFrameMode i_dialogFrameMode = DialogFrameMode.None)
+        public void ShowForm(DialogFrameMode i_dialogFrameMode = DialogFrameMode.None)
         {
             this.dialogFrameMode = i_dialogFrameMode;
 
-            if (mainFrame != null)
-            {
-                mainFrame.AddChidren(this);
-                //鍒濆鍖栨甯冩帶浠�
-                this.InitframeControl();
-            }
+            //鍒濆鍖栨甯冩帶浠�
+            this.InitMiddleFrame();
         }
 
         /// <summary>
         /// 鍒濆鍖栨甯冩帶浠�
         /// </summary>
-        public void InitframeControl()
+        public void InitMiddleFrame()
         {
-            if (this.frameLayout != null)
-            {
-                this.frameLayout.RemoveAll();
-            }
-            else
-            {
-                this.BackgroundColor = UserCenterColor.Current.DialogBackColor;
-            }
-
             //杩欐槸涓�涓
             this.frameLayout = new FrameLayout();
             frameLayout.Height = Application.GetRealHeight(538);
@@ -282,7 +265,7 @@
             frameLayout.AddChidren(btnCancel);
             btnCancel.MouseUpEventHandler += (sender, e) =>
             {
-                this.RemoveFromParent();
+                this.CloseForm();
             };
 
             //纭
@@ -291,9 +274,15 @@
             frameLayout.AddChidren(btnOk);
             btnOk.MouseUpEventHandler += (sender, e) =>
             {
+                if (this.Text == string.Empty && this.txtInput != null && string.IsNullOrEmpty(this.txtInput.PlaceholderText) == false)
+                {
+                    var alert = new ShowMsgControl(ShowMsgType.Error, this.txtInput.PlaceholderText);
+                    alert.Show();
+                    return;
+                }
                 if (this.ComfirmClickEvent == null)
                 {
-                    this.RemoveFromParent();
+                    this.CloseForm();
                     return;
                 }
                 this.ComfirmClickEvent(this.Text);
@@ -334,10 +323,11 @@
         /// <summary>
         /// 鐢婚潰鍏抽棴
         /// </summary>
-        public void CloseDialog()
+        public override void CloseFormBefore()
         {
             this.ComfirmClickEvent = null;
-            this.RemoveFromParent();
+
+            base.CloseFormBefore();
         }
 
         #endregion

--
Gitblit v1.8.0