wxr
2020-01-10 1a4b95a7ebef71838bd3eda2c22056bbf0db65ec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
using System;
using Shared;
 
namespace HDL_ON.UI
{
    public partial class PersonalCenterPage
    {
        /// <summary>
        /// 加载事件列表
        /// </summary>
        void LoadEventList()
        {
            LoadEvent_SwitchHome();
            LoadEvent_GoPersonalDataPage();
        }
 
 
        #region 切换住宅
        /// <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;
                        dialog.Close();
 
                        UserConfig.Instance.CurrentRegion = regionInfo;
                        btnCurResidenceName.Text = regionInfo.Name;
                        UserConfig.Instance.SaveUserConfig();
                    };
                }
 
                dialog.Show();
            };
        }
 
        #endregion
 
 
        #region 个人中心
        void LoadEvent_GoPersonalDataPage()
        {
            btnUserHeadPortrait.MouseUpEventHandler += (sender, e) => {
                var personalDataView = new PersonalDataPage();
                MainPage.BasePageView.AddChidren(personalDataView);
                personalDataView.LoadView();
                MainPage.BasePageView.PageIndex = MainPage.BasePageView.ChildrenCount - 1;
            };
        }
        #endregion
    }
}