xm
2019-07-16 b910cb79c9b5bcc204022a3cf9e6950f0a64dfbd
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
using System;
using System.Collections.Generic;
using System.Text;
 
namespace Shared.Phone.UserCenter
{
    /// <summary>
    /// 做成一个信息的RowLayout(左边有个图标)
    /// </summary>
    public class OnlyCenterViewRow : StatuRowLayout
    {
        /// <summary>
        /// 图标控件
        /// </summary>
        public RowLeftIconView btnIcon = null;
        /// <summary>
        /// 显示文本控件
        /// </summary>
        public RowCenterView btnName = null;
 
        /// <summary>
        /// 做成一个信息的RowLayout(左边有个图标)
        /// </summary>
        /// <param name="listView">列表控件</param>
        /// <param name="i_txtValue">显示文本</param>
        /// <param name="i_unSelectPath">非选择的图标</param>
        /// <param name="i_selectPath">选择的图标</param>
        public OnlyCenterViewRow(VerticalScrolViewLayout listView, string i_txtValue, string i_unSelectPath = null, string i_selectPath = null)
        {
            listView.AddChidren(this);
            //初始化内部控件之前
            this.InitControlBefore(i_unSelectPath, i_selectPath, i_txtValue);
            //初始化内部控件
            this.InitControl();
        }
 
        /// <summary>
        /// 做成一个信息的RowLayout(左边有个图标),添加此控件到容器后,调用【InitControl()】完成初始化
        /// </summary>
        /// <param name="i_txtValue">显示文本</param>
        /// <param name="i_unSelectPath">非选择的图标</param>
        /// <param name="i_selectPath">选择的图标</param>
        public OnlyCenterViewRow(string i_txtValue, string i_unSelectPath = null, string i_selectPath = null)
        {
            //初始化内部控件之前
            this.InitControlBefore(i_unSelectPath, i_selectPath, i_txtValue);
        }
 
        /// <summary>
        /// 初始化内部控件
        /// </summary>
        public void InitControl()
        {
            //图标
            this.AddChidren(this.btnIcon);
 
            //显示文本
            this.AddChidren(this.btnName);
        }
 
        /// <summary>
        /// 将图标控件适配为【点号】控件
        /// </summary>
        public void ChangedIconInPointMode()
        {
            //将控件适配为【点号】控件
            this.btnIcon.ChangedControlInPointMode();
        }
 
        /// <summary>
        /// 初始化内部控件之前
        /// </summary>
        /// <param name="i_unSelectPath"></param>
        /// <param name="i_selectPath"></param>
        /// <param name="i_txtValue"></param>
        private void InitControlBefore(string i_unSelectPath, string i_selectPath, string i_txtValue)
        {
            this.btnIcon = new RowLeftIconView();
            this.btnIcon.UnSelectedImagePath = i_unSelectPath;
            this.btnIcon.SelectedImagePath = i_selectPath;
 
            this.btnName = new RowCenterView();
            this.btnName.Text = i_txtValue;
        }
    }
}