From 25429f085093d89d543a0b90e30d0d62d1b7dac9 Mon Sep 17 00:00:00 2001
From: hxb <hxb@hdlchina.com.cn>
Date: 星期二, 30 八月 2022 09:37:38 +0800
Subject: [PATCH] 合并了IOS的代码
---
ZigbeeApp/Shared/Phone/CommonForm/DialogCommonForm.cs | 116 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 116 insertions(+), 0 deletions(-)
diff --git a/ZigbeeApp/Shared/Phone/CommonForm/DialogCommonForm.cs b/ZigbeeApp/Shared/Phone/CommonForm/DialogCommonForm.cs
new file mode 100644
index 0000000..404bf8b
--- /dev/null
+++ b/ZigbeeApp/Shared/Phone/CommonForm/DialogCommonForm.cs
@@ -0,0 +1,116 @@
+锘縰sing Shared.Phone.UserCenter;
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace Shared.Phone
+{
+ /// <summary>
+ /// 寮圭獥鍨嬬殑鐣岄潰鐨勫熀灞傜晫闈�
+ /// </summary>
+ public class DialogCommonForm : CommonFormBase
+ {
+ #region 鈻� 鍙橀噺澹版槑___________________________
+
+ /// <summary>
+ /// bodyFrameLayout
+ /// </summary>
+ public FrameLayout bodyFrameLayout = null;
+ /// <summary>
+ /// 鐐瑰嚮鑳屾櫙鐨勬椂鍊欙紝鍏抽棴鐣岄潰
+ /// </summary>
+ public bool CloseFormByClickBack = true;
+ /// <summary>
+ /// 璋冪敤AddForm鍑芥暟鏃�,鏄惁鑷姩璋冪敤ShowForm鍑芥暟,,榛樿鑷姩璋冪敤
+ /// </summary>
+ public bool AutoLoadShowFormMethord = true;
+ /// <summary>
+ /// 鍘熸潵鐨勬粦鍔ㄦ爣璇�
+ /// </summary>
+ private bool oldScrollEnabled = false;
+
+ #endregion
+
+ #region 鈻� 鍒濆鍖朹____________________________
+
+ /// <summary>
+ /// 鍒濆鍖栫晫闈㈡鏋�
+ /// </summary>
+ public override void InitForm()
+ {
+ this.oldScrollEnabled = UserView.HomePage.Instance.ScrollEnabled;
+ UserView.HomePage.Instance.ScrollEnabled = false;
+
+ base.InitForm();
+
+ bodyFrameLayout = new FrameLayout();
+ bodyFrameLayout.BackgroundColor = UserCenterColor.Current.DialogBackColor;
+ this.AddChidren(bodyFrameLayout);
+
+ bodyFrameLayout.MouseUpEventHandler += (sender, e) =>
+ {
+ if (CloseFormByClickBack == true)
+ {
+ //鍏抽棴鑷韩
+ this.CloseForm();
+ }
+ };
+ }
+
+ #endregion
+
+ #region 鈻� 娣诲姞鐣岄潰___________________________
+
+ /// <summary>
+ /// 娣诲姞鐢婚潰,鍚姩鍙傛暟鐢辨寚瀹氱敾闈㈢殑ShowForm鍑芥暟鎵�鎸囧畾
+ /// </summary>
+ /// <param name="parameter">鍚姩鍙傛暟锛氬弬鏁扮敱鎸囧畾鐢婚潰鐨凷howForm鍑芥暟鎵�鎸囧畾</param>
+ public override void AddForm(params object[] parameter)
+ {
+ base.AddForm(parameter);
+
+ //妫�娴嬭兘鍚﹁拷鍔犵敾闈�
+ if (UserCenterLogic.CheckCanAddForm(this) == false)
+ {
+ return;
+ }
+ var nowForm = UserView.HomePage.Instance.GetChildren(UserView.HomePage.Instance.ChildrenCount - 1);
+ if (nowForm == null || (nowForm is ViewGroup) == false)
+ {
+ //杩欑鎯呭喌搴旇涓嶅瓨鍦�
+ this.ShowMassage(ShowMsgType.Error, "ERROR:Not Found The ActionForm!");
+ return;
+ }
+ ((ViewGroup)nowForm).AddChidren(this);
+
+ //鍒濆鍖栫晫闈㈡鏋�
+ this.InitForm();
+
+ if (this.AutoLoadShowFormMethord == true)
+ {
+ //鎵цShowForm()鏂规硶
+ this.LoadShowFormMethod(parameter);
+ }
+ }
+
+ #endregion
+
+ #region 鈻� 鍏抽棴鐣岄潰___________________________
+
+ /// <summary>
+ /// 鍏抽棴鐣岄潰
+ /// </summary>
+ public override void CloseFormBefore()
+ {
+ if (this.oldScrollEnabled == true)
+ {
+ //濡傛灉瀹冨師鏉ュ氨鏄笉鍙互婊戝姩鐨勮瘽锛屼笉澶勭悊
+ UserView.HomePage.Instance.ScrollEnabled = true;
+ }
+
+ base.CloseFormBefore();
+ }
+
+ #endregion
+ }
+}
--
Gitblit v1.8.0