| | |
| | | |
| | | }); |
| | | //音量+ |
| | | btn_jia.MouseDownEventHandler += (sender, e) => |
| | | btn_jia.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | btn_jia.IsSelected = true; |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.volume_add, ""); |
| | | this.SetButtonIsSelected(btn_jia); |
| | | |
| | | }; |
| | | //音量- |
| | | btn_jian.MouseDownEventHandler += (sender, e) => |
| | | btn_jian.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | btn_jian.IsSelected = true; |
| | | ControlCommand(HisenseTVFunctionalAttributeConstant.volume_subtract, ""); |
| | | this.SetButtonIsSelected(btn_jian); |
| | | }; |
| | | //菜单 |
| | | caidanBtn.SetClickListener((btn) => |
| | |
| | | |
| | | }; |
| | | yinliangFL.AddChidren(btn_jian); |
| | | btn_jia.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | btn_jia.IsSelected = false; |
| | | |
| | | }; |
| | | btn_jian.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | |
| | | btn_jian.IsSelected = false; |
| | | }; |
| | | |
| | | caidanBtn = new CustomButton(); |
| | | caidanBtn.TextID = StringId.caidan; |
| | |
| | | /// <summary> |
| | | /// 自定义(首页,关机,菜单)容器 |
| | | /// </summary> |
| | | class CustomFrameLayout : FrameLayout |
| | | class CustomFrameLayout : BaseFramLayout |
| | | { |
| | | public const int widthFrameLayout = 68; |
| | | public const int heightFrameLayout = 68 + 8 + 20; |
| | |
| | | /// <param name="button2">注意:在SetClickListener()前面调用AddImageView()才有效</param> |
| | | public void SetClickListener(Action<FrameLayout, Button, Button> action) |
| | | { |
| | | EventHandler<MouseEventArgs> DownClick = (sender, e) => |
| | | { |
| | | btnImage.IsSelected = true; |
| | | //btnText.IsSelected = true; |
| | | action?.Invoke(this, btnImage, btnText); |
| | | }; |
| | | this.MouseDownEventHandler += DownClick; |
| | | btnImage.MouseDownEventHandler += DownClick; |
| | | btnText.MouseDownEventHandler += DownClick; |
| | | |
| | | |
| | | EventHandler<MouseEventArgs> UpClick = (sender, e) => |
| | | { |
| | | btnImage.IsSelected = false; |
| | | //btnText.IsSelected = false; |
| | | action?.Invoke(this, btnImage, btnText); |
| | | SetButtonIsSelected(btnImage); |
| | | }; |
| | | this.MouseUpEventHandler += UpClick; |
| | | btnImage.MouseUpEventHandler += UpClick; |
| | |
| | | /// <param name="action">回调(第一个是父类对象</param> |
| | | public void SetClickListener(Action<Button> action) |
| | | { |
| | | EventHandler<MouseEventArgs> DownClick = (sender, e) => |
| | | { |
| | | //this.BackgroundColor = 0xFFF2F3F7; |
| | | this.IsSelected = true; |
| | | action?.Invoke(this); |
| | | }; |
| | | this.MouseDownEventHandler += DownClick; |
| | | |
| | | |
| | | EventHandler<MouseEventArgs> UpClick = (sender, e) => |
| | | { |
| | | //this.BackgroundColor = 0xffECEDEE; |
| | | this.IsSelected = false; |
| | | |
| | | action?.Invoke(this); |
| | | new BaseFramLayout().SetButtonIsSelected(this); |
| | | |
| | | }; |
| | | this.MouseUpEventHandler += UpClick; |
| | | |