using System; namespace Shared.Phone.UserCenter { /// /// 行控件的共通类(只针对长的控件) /// public class RowViewControlComon : ButtonCommon { /// /// 设置X轴与宽度 /// /// public void SetXPointAndWidth(bool hadPictrue) { if (hadPictrue == true) { this.X = Application.GetRealWidth(200); this.Width = Application.GetRealWidth(830); } else { this.X = ControlCommonResourse.XXLeft; this.Width = Application.GetRealWidth(950); } } } /// /// 行输入控件的共通类(只针对长的控件) /// public class RowTextControlComon : EditInputText { /// /// 设置X轴与宽度 /// /// public void SetXPointAndWidth(bool hadPictrue) { if (hadPictrue == true) { this.X = Application.GetRealWidth(200); this.Width = Application.GetRealWidth(830); } else { this.X = ControlCommonResourse.XXLeft; this.Width = Application.GetRealWidth(950); } } } /// /// 做成一个存在于RowLayout里面,并且处于上部(1/2)的控件, /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐 /// 原型是:针对上方是大型黑色字体的 /// public class RowTopBlackView : RowViewControlComon { /// /// 做成一个存在于RowLayout里面,并且处于上部(1/2)的控件, /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐 /// 原型是:针对上方是大型黑色字体的 /// /// 左边是否有图片 public RowTopBlackView(bool hadPictrue = true) { this.Height = ControlCommonResourse.ListViewRowHalfHeight; int YY = UserCenterLogic.GetControlChidrenYaxis(ControlCommonResourse.ListViewRowHeight, ControlCommonResourse.ListViewRowHalfHeight, UViewAlignment.Top); this.Y = YY + this.DeviationValue; //设置X轴与宽度 this.SetXPointAndWidth(hadPictrue); } } /// /// 做成一个存在于RowLayout里面,并且处于上部(1/2)的控件, /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐 /// 原型是:针对上方是小型灰色字体的 /// public class RowTopGrayView : RowViewControlComon { /// /// 做成一个存在于RowLayout里面,并且处于上部(1/2)的控件, /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐 /// 原型是:针对上方是小型灰色字体的 /// /// 左边是否有图片 public RowTopGrayView(bool hadPictrue = true) { this.Height = ControlCommonResourse.ListViewRowHalfHeight; int YY = UserCenterLogic.GetControlChidrenYaxis(ControlCommonResourse.ListViewRowHeight, ControlCommonResourse.ListViewRowHalfHeight, UViewAlignment.Top); this.Y = YY + this.DeviationValue; this.TextColor = UserCenterColor.Current.TextGrayColor; //设置X轴与宽度 this.SetXPointAndWidth(hadPictrue); } } /// /// 做成一个存在于RowLayout里面,并且处于底部(1/2)的控件, /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐 /// 原型是:针对下方是大型黑色字体的 /// public class RowBottomBlackView : RowViewControlComon { /// /// 做成一个存在于RowLayout里面,并且处于底部(1/2)的控件, /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐 /// 原型是:针对下方是大型黑色字体的 /// /// 左边是否有图片 public RowBottomBlackView(bool hadPictrue = true) { this.Height = ControlCommonResourse.ListViewRowHalfHeight; int YY = UserCenterLogic.GetControlChidrenYaxis(ControlCommonResourse.ListViewRowHeight, ControlCommonResourse.ListViewRowHalfHeight, UViewAlignment.Bottom); this.Y = YY - this.DeviationValue; //设置X轴与宽度 this.SetXPointAndWidth(hadPictrue); } } /// /// 做成一个存在于RowLayout里面,并且处于底部(1/2)的控件, /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐 /// 原型是:针对下方是小型灰色字体的 /// public class RowBottomGrayView : RowViewControlComon { /// /// 做成一个存在于RowLayout里面,并且处于底部(1/2)的控件, /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐 /// 原型是:针对下方是小型灰色字体的 /// /// 左边是否有图片 public RowBottomGrayView(bool hadPictrue = true) { this.Height = ControlCommonResourse.ListViewRowHalfHeight; int YY = UserCenterLogic.GetControlChidrenYaxis(ControlCommonResourse.ListViewRowHeight, ControlCommonResourse.ListViewRowHalfHeight, UViewAlignment.Bottom); this.Y = YY - this.DeviationValue; this.TextColor = UserCenterColor.Current.TextGrayColor; //设置X轴与宽度 this.SetXPointAndWidth(hadPictrue); } } /// /// 做成一个存在于RowLayout里面,只有一个显示信息控件的控件, /// 自动设置了宽度和高度,位置上下居中,以及字体颜色,X轴,Y轴,文字向左靠齐 /// public class RowCenterView : RowViewControlComon { /// /// 做成一个存在于RowLayout里面,只有一个显示信息控件的控件, /// 自动设置了宽度和高度,位置上下居中,以及字体颜色,X轴,Y轴,文字向左靠齐 /// /// 左边是否有图片 public RowCenterView(bool hadPictrue = true) { this.Height = ControlCommonResourse.ListViewRowOnlyViewHeight; this.Gravity = Gravity.CenterVertical; //设置X轴与宽度 this.SetXPointAndWidth(hadPictrue); } } /// /// 做成一个存在于RowLayout里面,并且处于底部(1/2)的输入框, /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐 /// public class RowBottomEditorText : RowTextControlComon { /// /// 做成一个存在于RowLayout里面,并且处于底部(1/2)的输入框, /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐 /// public RowBottomEditorText() { this.Height = ControlCommonResourse.ListViewRowHalfHeight; int YY = UserCenterLogic.GetControlChidrenYaxis(ControlCommonResourse.ListViewRowHeight, ControlCommonResourse.ListViewRowHalfHeight, UViewAlignment.Bottom); this.Y = YY - this.DeviationValue; //设置X轴与宽度 this.SetXPointAndWidth(false); } } /// /// 做成一个存在于RowLayout里面,并且处于中间的输入框, /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐 /// public class RowCenterEditorText : RowTextControlComon { /// /// 做成一个存在于RowLayout里面,并且处于中间的输入框, /// 自动设置了宽度和高度,以及字体颜色,X轴,Y轴,文字向左靠齐 /// public RowCenterEditorText() { this.Height = ControlCommonResourse.ListViewRowHalfHeight; this.Gravity = Gravity.CenterVertical; //设置X轴与宽度 this.SetXPointAndWidth(false); } } /// /// 做成一个存在于RowLayout里面(左滑或者右滑)的旁路设置按钮 /// public class RowBypassButton : ButtonCommon { /// /// 做成一个存在于RowLayout里面(左滑或者右滑)的旁路设置按钮 /// public RowBypassButton() { this.Height = ControlCommonResourse.ListViewRowHeight; this.Width = Application.GetRealWidth(177); this.TextID = R.MyInternationalizationString.uBypass; this.BackgroundColor = UserCenterColor.Current.DeepBlue; this.TextColor = UserCenterColor.Current.White; this.TextAlignment = TextAlignment.Center; //this.UnSelectedImagePath = "Safeguard/Bypass.png"; } } /// /// 做成一个存在于RowLayout里面(左滑或者右滑)的删除按钮 /// public class RowDeleteButton : ButtonCommon { /// /// 做成一个存在于RowLayout里面(左滑或者右滑)的删除按钮 /// public RowDeleteButton() { this.Height = ControlCommonResourse.ListViewRowHeight; this.Width = Application.GetRealWidth(177); this.BackgroundColor = UserCenterColor.Current.RowDeleteButtonColor; this.TextAlignment = TextAlignment.Center; this.TextColor = UserCenterColor.Current.White; this.TextID = R.MyInternationalizationString.uDelete; } } /// /// 做成一个存在于RowLayout里面(左滑或者右滑)的解除绑定按钮 /// public class RowUnBindButton : ButtonCommon { /// /// 做成一个存在于RowLayout里面(左滑或者右滑)的解除绑定按钮 /// public RowUnBindButton() { this.Height = ControlCommonResourse.ListViewRowHeight; this.Width = Application.GetRealWidth(177); this.BackgroundColor = UserCenterColor.Current.RowDeleteButtonColor; this.TextAlignment = TextAlignment.Center; this.TextColor = UserCenterColor.Current.White; this.TextID = R.MyInternationalizationString.uUnBinded; } } /// /// 做成一个存在于RowLayout里面(左滑或者右滑)的编辑按钮 /// public class RowEditorButton : ButtonCommon { /// /// 做成一个存在于RowLayout里面(左滑或者右滑)的编辑按钮 /// public RowEditorButton() { this.Height = ControlCommonResourse.ListViewRowHeight; this.Width = Application.GetRealWidth(177); this.BackgroundColor = UserCenterColor.Current.RowEditorButtonColor; this.TextAlignment = TextAlignment.Center; this.TextColor = UserCenterColor.Current.White; this.TextID = R.MyInternationalizationString.uEditor; } } /// /// 做成一个位于RowLayout中间的密码输入控件,右边会有个可以显示密码的图标 /// 在添加此控件到画面后,请调用Init()函数执行内部控件的添加 /// public class RowPasswordControl : RowLayout { /// /// 文本框的值 /// public string Text { get { if (txtText == null) { return string.Empty; } return txtText.Text; } set { if (txtText == null) { return; } txtText.Text = value; } } /// /// 输入框控件 /// private RowCenterEditorText txtText = null; /// /// 做成一个位于RowLayout中间的密码输入控件,右边会有个可以显示密码的图标 /// 在添加此控件到画面后,请调用Init()函数执行内部控件的添加 /// public RowPasswordControl() { this.Height = ControlCommonResourse.ListViewRowHeight; } /// /// 初始化内部控件(此控件添加到画面后才调用此方法) /// /// 输入框的提示信息,有值时会消失 public void Init(string placeholderText = null) { txtText = new RowCenterEditorText(); txtText.SecureTextEntry = true; this.AddChidren(txtText); if (placeholderText != null) { txtText.PlaceholderText = placeholderText; txtText.PlaceholderTextColor = UserCenterColor.Current.TextTipColor; } var btnView = new MostRightEmptyView(); btnView.UnSelectedImagePath = "Account/HidenPWD.png"; btnView.SelectedImagePath = "Account/UnHidenPWD.png"; this.AddChidren(btnView); btnView.MouseDownEventHandler += (sender, e) => { btnView.IsSelected = !btnView.IsSelected; txtText.SecureTextEntry = !txtText.SecureTextEntry; }; } } /// /// 做成存在于Rowlayout里面,向右图标的控件(初始值:控件上下居中,向右停靠), /// 无自身点亮功能,交由StatuRowLayout控件处理。也可以使用于Rowlayout外面 /// public class RowRightIconView : MostRightEmptyView { /// /// 做成存在于Rowlayout里面,向右图标的控件(初始值:控件上下居中,向右停靠), /// 无自身点亮功能,交由StatuRowLayout控件处理。也可以使用于Rowlayout外面 /// public RowRightIconView() { this.UnSelectedImagePath = "Item/Next.png"; this.SelectedImagePath = "Item/NextSelected.png"; } } /// /// 做成一个位于Rowlayout里面,最右边的文本显示控件. /// 初始值:控件上下居中,文字向右靠齐,标准字体及颜色 /// public class RowMostRightTextView : ButtonCommon { /// /// 做成一个位于Rowlayout里面,最右边的文本显示控件. /// 初始值:位置上下居中,文字向右靠齐,标准字体及颜色 /// public RowMostRightTextView() { this.X = Application.GetRealWidth(700); this.Height = ControlCommonResourse.NormalControlHeight; this.Width = Application.GetRealWidth(320); this.TextAlignment = TextAlignment.CenterRight; this.Gravity = Gravity.CenterVertical; } } /// /// 做成一个位于Rowlayout里面在左边显示的图标 /// public class RowLeftIconView : ButtonIconCommon { /// /// 是否是点号模式 /// public bool PointMode = false; /// /// X轴偏移量,因为点号不是110X110 /// private int xValue = Application.GetRealWidth((110 - 82) / 2); /// /// 做成一个位于Rowlayout里面在左边显示的图标 /// public RowLeftIconView() { this.InitAvgSize(110, 110, true); this.X = ControlCommonResourse.XXLeft; this.Gravity = Gravity.CenterVertical; } /// /// 将控件适配为【点号】控件 /// public void ChangedControlInPointMode() { this.PointMode = true; this.InitAvgSize(82, 110, true); if (this.Parent == null) { this.X = ControlCommonResourse.XXLeft + xValue; } else { this.X += xValue; } this.UnSelectedImagePath = "Item/Point.png"; this.SelectedImagePath = "Item/PointSelected.png"; this.Gravity = Gravity.CenterVertical; } /// /// 将控件还原为原来的大小 /// public void ChangedControlInNormalMode() { this.PointMode = false; this.InitAvgSize(110, 110, true); if (this.Parent == null) { this.X = ControlCommonResourse.XXLeft; } else { this.X -= xValue; } this.Gravity = Gravity.CenterVertical; } } /// /// 做成一个位于Rowlayout里面,从最右边开始,位于第二位的文本显示控件. /// 初始值:控件上下居中,文字向右靠齐,标准字体及颜色 /// public class RowSecondRightTextView : ButtonCommon { /// /// 做成一个位于Rowlayout里面,从最右边开始,位于第二位的文本显示控件. /// 初始值:位置上下居中,文字向右靠齐,标准字体及颜色 /// public RowSecondRightTextView() { this.X = Application.GetRealWidth(650); this.Height = ControlCommonResourse.NormalControlHeight; this.Width = Application.GetRealWidth(270); this.TextAlignment = TextAlignment.CenterRight; this.Gravity = Gravity.CenterVertical; } } /// /// 做成一个位于Rowlayout里面,从最右边开始,位于第二位的图片显示控件. /// 初始值:控件上下居中, /// public class RowSecondRightIconView : ButtonIconCommon { /// /// 做成一个位于Rowlayout里面,从最右边开始,位于第二位的图片显示控件. /// 初始值:位置上下居中 /// /// 大小 /// 是否计算真实值 public RowSecondRightIconView(int size = 110, bool real = true) { this.InitAvgSize(size, size, real); this.X = Application.GetRealWidth(820); this.Gravity = Gravity.CenterVertical; //启用点亮功能 this.UseClickStatu = true; } } /// /// 做成一个位于RowLayout里面,用来显示的【小控件】, /// 初始值:不设置X轴,位置上下居中,文字居中,标准字体及颜色,圆化度:4 /// public class RowLittleViewButton : ButtonCommon { /// /// 做成一个位于RowLayout里面,用来显示的【小控件】, /// 初始值:不设置X轴,位置上下居中,文字居中,标准字体及颜色,圆化度:4 /// /// 宽度 /// 是否计算真实值 public RowLittleViewButton(int i_Width, bool real = false) { this.InitSize(i_Width, real); this.Gravity = Gravity.CenterVertical; this.Radius = 4; this.TextAlignment = TextAlignment.Center; } } /// /// 做成一个位于RowLayout里面,用来单击的【小控件】, /// 初始值:不设置X轴,位置上下居中,文字居中,标准白色字体,蓝色背景,圆化度:半圆 /// public class RowLittleClickButton : ClickButtonCommon { /// /// 做成一个位于RowLayout里面,用来单击的【小控件】, /// 初始值:不设置X轴,位置上下居中,文字居中,标准白色字体,蓝色背景,圆化度:半圆 /// /// 宽度 /// 是否计算真实值 public RowLittleClickButton(int i_Width, bool real = false) { this.InitSize(i_Width, real); this.Gravity = Gravity.CenterVertical; this.Radius = (uint)ControlCommonResourse.NormalControlHeight / 2; this.UseClickStatu = true; } } /// /// 做成一个位于Rowlayout里面,提示拥有新版本的控件 /// public class RowNewVersionTipView : ButtonCommon { /// /// 做成一个位于Rowlayout里面,提示拥有新版本的控件 /// public RowNewVersionTipView() { this.X = Application.GetRealWidth(720); this.Height = ControlCommonResourse.NormalControlHeight; this.Width = Application.GetRealWidth(200); this.TextAlignment = TextAlignment.Center; this.Gravity = Gravity.CenterVertical; this.Radius = (uint)ControlCommonResourse.NormalControlHeight / 2; this.BackgroundColor = UserCenterColor.Current.Red; this.TextColor = UserCenterColor.Current.White; this.TextID = R.MyInternationalizationString.uNEW; } } }