From 9aa32bd5ed75d54b2141b6c91f163d43216a3643 Mon Sep 17 00:00:00 2001
From: wxr <464027401@qq.com>
Date: 星期五, 06 十二月 2019 13:14:02 +0800
Subject: [PATCH] 20191206

---
 HDL_ON/UI/UI2/4-PersonalCenter/BLL/PersonalCenterPageBLL.cs |   94 +++++++++++++++++++++++++++++++++++++++++++++++
 1 files changed, 94 insertions(+), 0 deletions(-)

diff --git a/HDL_ON/UI/UI2/4-PersonalCenter/BLL/PersonalCenterPageBLL.cs b/HDL_ON/UI/UI2/4-PersonalCenter/BLL/PersonalCenterPageBLL.cs
index 9924a8e..da05712 100644
--- a/HDL_ON/UI/UI2/4-PersonalCenter/BLL/PersonalCenterPageBLL.cs
+++ b/HDL_ON/UI/UI2/4-PersonalCenter/BLL/PersonalCenterPageBLL.cs
@@ -1,7 +1,101 @@
 锘縰sing System;
+using Shared;
+
 namespace HDL_ON.UI2
 {
     public partial class PersonalCenterPage
     {
+        /// <summary>
+        /// 鍔犺浇浜嬩欢鍒楄〃
+        /// </summary>
+        void LoadEventList()
+        {
+            LoadEvent_SwitchHome();
+        }
+
+        /// <summary>
+        /// 浣忓畢鍒楄〃鐐瑰嚮浜嬩欢
+        /// </summary>
+        void LoadEvent_SwitchHome()
+        {
+            btnCurResidenceName.MouseUpEventHandler += (sender, e) => {
+                var dialog = new Dialog();
+                var dialogBody = new FrameLayout();
+                dialog.AddChidren(dialogBody);
+                dialogBody.MouseUpEventHandler += (sender1, e1) => {
+                    dialog.Close();
+                };
+
+                var dispalyView = new FrameLayout()
+                {
+                    X = Application.GetRealWidth(22),
+                    Y = Application.GetRealHeight(268),
+                    Width = Application.GetRealWidth(160),
+                    Height = Application.GetRealHeight(190),
+                    BackgroundImagePath = "PersonalCenter/HomeListbg.png",
+                };
+                dialogBody.AddChidren(dispalyView);
+
+                var contentView = new VerticalScrolViewLayout() {
+                    X = Application.GetRealWidth(8),
+                    Y = Application.GetRealHeight(16),
+                    Width = Application.GetRealWidth(144),
+                    Height = Application.GetRealHeight(45*4),
+                };
+                dispalyView.AddChidren(contentView);
+
+          
+                foreach(var home in MainPage.LoginUser.HomeLists)
+                {
+                    var btnHomeName = new Button()
+                    {
+                        Gravity = Gravity.CenterHorizontal,
+                        Width = Application.GetRealWidth(112),
+                        Height = Application.GetRealHeight(44),
+                        TextAlignment = TextAlignment.CenterLeft,
+                        TextColor = UI.CSS.CSS_Color.MainBackgroundColor,
+                        SelectedTextColor = UI.CSS.CSS_Color.MainColor,
+                        Text = home.Name,
+                        TextSize = UI.CSS.CSS_FontSize.SubheadingFontSize,
+                        IsSelected = UserConfig.Instance.CurrentRegion.RegionID == home.RegionID,
+                        IsMoreLines = true,
+                        Tag = home
+                    };
+                    contentView.AddChidren(btnHomeName);
+                    var btnContentLine = new Button()
+                    {
+                        Gravity = Gravity.CenterHorizontal,
+                        Width = Application.GetRealWidth(112),
+                        Height = Application.GetRealHeight(1),
+                        BackgroundColor = UI.CSS.CSS_Color.SecondLevelTitleColor
+                    };
+                    contentView.AddChidren(btnContentLine);
+
+                    btnHomeName.MouseUpEventHandler += (senderH, en) =>
+                    {
+                        var regionInfo = btnHomeName.Tag as RegionInfoRes;
+                        //LoadMothed_SwitchHome(regionInfo);
+
+                        UserConfig.Instance.CurrentRegion = regionInfo;
+                        btnCurResidenceName.Text = regionInfo.Name;
+                        UserConfig.Instance.SaveUserConfig();
+                    };
+                }
+
+                dialog.Show();
+            };
+        }
+
+        /// <summary>
+        /// 鍒囨崲浣忓畢
+        /// </summary>
+        /// <param name="regionInfo"></param>
+        void LoadMothed_SwitchHome(RegionInfoRes regionInfo)
+        {
+            UserConfig.Instance.CurrentRegion = regionInfo;
+            btnCurResidenceName.Text = regionInfo.Name;
+            UserConfig.Instance.SaveUserConfig();
+        }
+
     }
 }

--
Gitblit v1.8.0