wjc
2023-02-14 c88a3777ab456af4ecf01604f4b2ae4762852148
HDL_ON/UI/UI2/2-Classification/FunctionPage.cs
@@ -215,15 +215,40 @@
            #endregion
        }
        /// <summary>
        /// 显示的设备的总数
        /// </summary>
        int showCount = 0;
        /// <summary>
        /// 加载功能row
        /// </summary>
        void ShowFunctionRow(List<Function> showList)
        void ShowFunctionRow(List<Function> showList, bool isAppend = false)
        {
            var waitPage = new Loading();
            bodyView.AddChidren(waitPage);
            waitPage.Start("");
            new System.Threading.Thread(() =>
            {
                try
                {
                    Application.RunOnMainThread(() =>
                    {
                        if (!isAppend)
                        {
                            showCount = 0;
            functionListView.RemoveAll();
                        }
                        int i = 0;
            foreach (var function in showList)
            {
                            i++;
                            if (i > 50)
                            {
                                break;
                            }
                            showCount++;
                if(function.spk == SPK.SensorDryContact|| function.spk == SPK.SensorDryContact2)
                {
                    continue;
@@ -279,6 +304,47 @@
                }
                functionListView.AddChidren(new Button() { Height = Application.GetRealHeight(10) });
            }
                        if (showList.Count > showCount)
                        {
                            var btnAppend = new Button()
                            {
                                Height = Application.GetRealHeight(60),
                                TextAlignment = TextAlignment.Center,
                                TextSize = CSS_FontSize.SubheadingFontSize,
                                TextColor = CSS_Color.FirstLevelTitleColor,
                                Text = "加载更多",
                            };
                            if (Language.CurrentLanguage != "Chinese")
                            {
                                btnAppend.Text = "Load more";
                            }
                            functionListView.AddChidren(btnAppend);
                            btnAppend.MouseUpEventHandler = (sender, e) =>
                            {
                                btnAppend.RemoveFromParent();
                                ShowFunctionRow(showList, true);
                            };
                        }
                    });
                }
                catch (Exception ex)
                {
                    MainPage.Log("ShowFunctionRowError : " + ex.Message);
                }
                finally
                {
                    Application.RunOnMainThread(() =>
                    {
                        if (waitPage != null)
                        {
                            waitPage.RemoveFromParent();
                            waitPage = null;
                        }
                    });
                }
            })
            { IsBackground = true }.Start();
        }