From 0fa1534827bd21d763216550d11006fc1441c6cb Mon Sep 17 00:00:00 2001
From: tzy <hxb@hdlchina.com.cn>
Date: 星期五, 14 五月 2021 17:08:45 +0800
Subject: [PATCH] 门锁初始上传

---
 HDL_ON/UI/UI0-Stan/Controls/CompoundControls/SeekBarImageControl.cs |   64 ++++++++++++++++++++++++++++++-
 1 files changed, 61 insertions(+), 3 deletions(-)

diff --git a/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/SeekBarImageControl.cs b/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/SeekBarImageControl.cs
index 8c66d48..6579b0d 100644
--- a/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/SeekBarImageControl.cs
+++ b/HDL_ON/UI/UI0-Stan/Controls/CompoundControls/SeekBarImageControl.cs
@@ -7,7 +7,8 @@
 namespace HDL_ON.Stan
 {
     /// <summary>
-    /// 宸﹀彸婊戝姩鐨勮繘搴︽潯鎺т欢
+    /// <para>宸﹀彸婊戝姩鐨勮繘搴︽潯鎺т欢(楂樺害涓�54 宸﹀彸闂磋窛涓�20)</para>
+    /// <para>濡傛灉鏄姞鍦≒ageLayout閲岄潰鐨勮瘽,鍔犲叆鐖舵帶浠朵箣鍚�,璇疯皟鐢˙indPageLayout()</para>
     /// </summary>
     public class SeekBarImageControl : DiyImageSeekBar
     {
@@ -112,20 +113,25 @@
         /// 涓婃柟鏄剧ず鐨勬枃鏈�
         /// </summary>
         private Button btnTopView = null;
+        /// <summary>
+        /// 缁戝畾PageLayout锛屼簨浠跺啿绐�,闇�瑕佺壒娈婂鐞�
+        /// </summary>
+        private PageLayout pageLayoutBind = null;
 
         #endregion
 
         #region 鈻� 鍒濆鍖朹____________________________
 
         /// <summary>
-        /// 宸﹀彸婊戝姩鐨勮繘搴︽潯鎺т欢(楂樺害涓�54 宸﹀彸闂磋窛涓�20)
+        /// <para>宸﹀彸婊戝姩鐨勮繘搴︽潯鎺т欢(楂樺害涓�54 宸﹀彸闂磋窛涓�20)</para>
+        /// <para>濡傛灉鏄姞鍦≒ageLayout閲岄潰鐨勮瘽,鍔犲叆鐖舵帶浠朵箣鍚�,璇疯皟鐢˙indPageLayout()</para>
         /// </summary>
         /// <param name="i_width">瀹藉害,闈炵湡瀹炲��,瀹為檯瀹藉害浼氬姞涓婂乏鍙抽棿璺�</param>
         public SeekBarImageControl(int i_width)
         {
             this.ProgressChangeDelayTime = 0;
 
-            this.Width = Application.GetRealWidth(i_width) + Application.GetRealWidth(20) * 2;
+            this.Width = Application.GetRealWidth(i_width) + m_SeekBarPadding * 2;
             this.Height = Application.GetRealHeight(54);
             //鍦嗙悆鐨勯珮搴�
             this.ThumbImageHeight = Application.GetRealHeight(54);
@@ -178,8 +184,27 @@
                 this.OnStopTrackingTouchEvent -= this.MyStopTrackingTouchEvent;
                 return;
             }
+            if (this.pageLayoutBind != null && this.pageLayoutBind.ScrollEnabled == false)
+            {
+                //浜嬩欢鍐茬獊,鐗规畩澶勭悊,璁﹑ageLayout杩樺師婊戝姩
+                this.pageLayoutBind.ScrollEnabled = true;
+            }
             //寮硅捣浜嬩欢涓嶉渶瑕佸垽鏂椂闂�
             this.ProgressChangedEvent(1, value);
+        }
+
+        /// <summary>
+        /// 鎵嬫寚寮�濮嬬偣鍑讳簨浠�
+        /// </summary>
+        /// <param name="sender"></param>
+        /// <param name="value"></param>
+        private void MyStartTrackingTouchEvent(object sender, bool value)
+        {
+            if (this.pageLayoutBind != null && this.pageLayoutBind.ScrollEnabled == true)
+            {
+                //浜嬩欢鍐茬獊,鐗规畩澶勭悊,璁﹑ageLayout涓嶈兘婊戝姩
+                this.pageLayoutBind.ScrollEnabled = false;
+            }
         }
 
         #endregion
@@ -237,11 +262,44 @@
         #region 鈻� 涓�鑸柟娉昣__________________________
 
         /// <summary>
+        /// 缁戝畾PageLayout
+        /// </summary>
+        public void BindPageLayout()
+        {
+            //鑾峰彇PageLayout
+            this.pageLayoutBind = this.GetParentPageLayout();
+            if (this.pageLayoutBind == null) { return; }
+
+            this.OnStartTrackingTouchEvent -= this.MyStartTrackingTouchEvent;
+            this.OnStartTrackingTouchEvent += this.MyStartTrackingTouchEvent;
+        }
+
+        /// <summary>
+        /// 鑾峰彇鐖舵帶浠剁殑PageLayout
+        /// </summary>
+        /// <returns></returns>
+        private PageLayout GetParentPageLayout()
+        {
+            ViewGroup viewGroup = this.Parent;
+            while (true)
+            {
+                if (viewGroup == null) { return null; }
+                else if (viewGroup is PageLayout)
+                {
+                    return (PageLayout)viewGroup;
+                }
+                viewGroup = viewGroup.Parent;
+            }
+        }
+
+        /// <summary>
         /// 鎺т欢鎽ф瘉
         /// </summary>
         public override void RemoveFromParent()
         {
+            this.pageLayoutBind = null;
             this.ProgressChangedEvent = null;
+
             base.RemoveFromParent();
         }
 

--
Gitblit v1.8.0