| | |
| | | TextAlignment = TextAlignment.Center, |
| | | Gravity = Gravity.CenterHorizontal, |
| | | Padding = new Padding(0, 20, 0, 20), |
| | | IsMoreLines = true, |
| | | Name = "btnName", |
| | | |
| | | |
| | |
| | | /// </summary> |
| | | public void AddLeftLine() |
| | | { |
| | | btnLeftLine.Height = this.Height; |
| | | this.AddChidren(btnLeftLine); |
| | | } |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public void AddRightLine() |
| | | { |
| | | btnRightLine.Height = this.Height; |
| | | btnRightLine.X = this.Width - Application.GetRealWidth(1); |
| | | this.AddChidren(btnRightLine); |
| | | } |
| | | |
| | |
| | | /// </summary> |
| | | public void AddTopLine() |
| | | { |
| | | btnTopLine.Width = this.Width; |
| | | this.AddChidren(btnTopLine); |
| | | } |
| | | /// <summary> |
| | |
| | | /// </summary> |
| | | public void AddBottomLine() |
| | | { |
| | | btnBottomLine.Y = this.Height - Application.GetRealHeight(1); |
| | | btnBottomLine.Width = this.Width; |
| | | this.AddChidren(btnBottomLine); |
| | | } |
| | | |
| | |
| | | EventHandler<MouseEventArgs> UpClick = (sender, e) => |
| | | { |
| | | this.BackgroundColor = 0x00000000; |
| | | action?.Invoke(this, btnImage, btnName); |
| | | |
| | | //弹起来还原背景颜色 |
| | | }; |
| | | this.Tag = "Cancel"; |
| | | btnImage.Tag = this.Tag; |
| | | btnName.Tag = this.Tag; |
| | | |
| | | this.MouseUpEventHandler += UpClick; |
| | | btnImage.MouseUpEventHandler += UpClick; |
| | | btnName.MouseUpEventHandler += UpClick; |
| | |
| | | |
| | | //EventHandler<MouseEventArgs> MoveClick = (sender, e) => |
| | | //{ |
| | | // Console.WriteLine("移动事件====="); |
| | | // this.BackgroundColor = 0x00000000; |
| | | // action?.Invoke(this, btnImage, btnName); |
| | | // //弹起来还原背景颜色 |
| | | //}; |
| | | //this.MouseMoveEventHandler += MoveClick; |
| | |
| | | |
| | | EventHandler<MouseEventArgs> DownClick = (sender, e) => |
| | | { |
| | | |
| | | //按下去改变背景颜色 |
| | | this.BackgroundColor = 0xff454635; |
| | | this.BackgroundColor = 0xFFEFEFEF; |
| | | action?.Invoke(this, btnImage, btnName); |
| | | }; |
| | | |
| | | this.MouseDownEventHandler += DownClick; |
| | | btnImage.MouseDownEventHandler += DownClick; |
| | | btnName.MouseDownEventHandler += DownClick; |