| | |
| | | /// </summary> |
| | | public bool IsDrawerLockMode; |
| | | |
| | | /// <summary> |
| | | /// ProgressBtn |
| | | /// </summary> |
| | | Button ProgressBtn; |
| | | /// <summary> |
| | | /// ProgressBtnY |
| | | /// </summary> |
| | | int ProgressBtnY; |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 接口___________________________ |
| | |
| | | { |
| | | curtainSeekBar.Progress = rollerShade.WcdCurrentPositionLiftPercentage; |
| | | } |
| | | //SeekBar.Progress = rollerShade.WcdCurrentPositionLiftPercentage; |
| | | //seekBarTitle.Text = $"{SeekBar.Progress} %"; |
| | | rollerShade.LastDateTime = DateTime.Now; |
| | | } |
| | | else if (common.DeviceStatusReport.AttriBute[0].AttributeId == 0) |
| | |
| | | //upBtn.MouseUpEventHandler += Up; |
| | | //stopBtn.MouseUpEventHandler += Stop; |
| | | //downBtn.MouseUpEventHandler += Down; |
| | | //SeekBar.ProgressChanged += SeekBar_ProgressChange; |
| | | //collectionBtn.MouseUpEventHandler += Collection; |
| | | //moreBtn.MouseUpEventHandler += More; |
| | | //roomBtn.MouseUpEventHandler += BackToRoomHandler; |
| | | //roomName.MouseUpEventHandler += BackToRoomHandler; |
| | | collectionBtn.MouseUpEventHandler += Collection; |
| | | } |
| | | |
| | | #endregion |
| | | |
| | | #region ◆ 控制___________________________ |
| | | |
| | | /// <summary> |
| | | /// 滑条移动发送命令 |
| | | /// </summary> |
| | | /// <param name="sender">Sender.</param> |
| | | /// <param name="mouseEventArgs">The ${ParameterType} instance containing the event data.</param> |
| | | private void SeekBar_ProgressChange(object sender, int mouseEventArgs) |
| | | { |
| | | //seekBarTitle.Text = $"{SeekBar.Progress}%"; |
| | | //(device.CommonDevice as ZigBee.Device.Rollershade).WcdGoToTiltValue(SeekBar.Progress); |
| | | } |
| | | |
| | | #region ◆ 控制__________________________ |
| | | |
| | | /// <summary> |
| | | /// 上、开 |
| | |
| | | curtainRollSeekBar.Gravity = Gravity.CenterHorizontal; |
| | | curtainRollSeekBar.Progress = (device.CommonDevice as Rollershade).WcdCurrentPositionLiftPercentage; |
| | | layout.AddChidren(curtainRollSeekBar); |
| | | curtainRollSeekBar.IsProgressTextShow = false; |
| | | //curtainRollSeekBar.OnStopTrackingTouchEvent += (sender, e) => |
| | | //{ |
| | | // (device.CommonDevice as Rollershade).WcdGoToTiltValue(curtainRollSeekBar.Progress); |
| | | //}; |
| | | |
| | | curtainRollSeekBar.OnStartTrackingTouchEvent += (sender, e) => |
| | | { |
| | | OnProgressButtonMove(curtainRollSeekBar.Progress); |
| | | ProgressBtn.Visible = true; |
| | | }; |
| | | |
| | | curtainRollSeekBar.OnStopTrackingTouchEvent += (sender, e) => |
| | | { |
| | | ProgressBtn.Visible = false; |
| | | }; |
| | | |
| | | curtainRollSeekBar.OnProgressChangedEvent += (send2, e2) => |
| | | { |
| | | |
| | | OnProgressButtonMove(e2); |
| | | |
| | | //判断是否300ms屏蔽 |
| | | if (curtainRollSeekBar.IsProgressChangeDelay()) return; |
| | | |
| | | (device.CommonDevice as Rollershade).WcdGoToTiltValue(curtainRollSeekBar.Progress); |
| | | }; |
| | | |
| | | InitProgressBtn(layout); |
| | | } |
| | | else |
| | | { |
| | |
| | | curtainSeekBar.Width = Application.GetRealWidth(570); |
| | | curtainSeekBar.Height = Application.GetRealHeight(513); |
| | | curtainSeekBar.Gravity = Gravity.CenterHorizontal; |
| | | curtainSeekBar.Progress = (device.CommonDevice as Rollershade).WcdCurrentPositionLiftPercentage; |
| | | layout.AddChidren(curtainSeekBar); |
| | | |
| | | curtainSeekBar.OnStopTrackingTouchEvent += (sender, e) => |
| | | { |
| | | (device.CommonDevice as Rollershade).WcdGoToTiltValue(curtainRollSeekBar.Progress); |
| | | (device.CommonDevice as Rollershade).WcdGoToTiltValue(curtainSeekBar.Progress); |
| | | }; |
| | | } |
| | | } |
| | | |
| | | /// <summary> |
| | | /// 添加进度按钮 |
| | | /// </summary> |
| | | private void InitProgressBtn(FrameLayout layout) |
| | | { |
| | | ProgressBtnY = curtainRollSeekBar.Y - Application.GetMinReal(204); |
| | | ProgressBtn = new Button() |
| | | { |
| | | Y = ProgressBtnY, |
| | | Width = Application.GetMinReal(135), |
| | | Height = Application.GetMinReal(104), |
| | | UnSelectedImagePath = "Item/ProgressBubbles.png", |
| | | Visible = false, |
| | | Gravity = Gravity.CenterHorizontal |
| | | }; |
| | | layout.AddChidren(ProgressBtn); |
| | | } |
| | | |
| | | /// <summary>
|
| | | /// OnProgressButtonMove
|
| | | /// </summary>
|
| | | private void OnProgressButtonMove(int mProgress)
|
| | | {
|
| | | ProgressBtn.Y = ProgressBtnY + curtainRollSeekBar.NowProgressY;
|
| | | ProgressBtn.Text = mProgress + "%";
|
| | | } |
| | | |
| | | #endregion |
| | | |
| | |
| | | /// <param name="e">E.</param> |
| | | private void Collection(object sender, MouseEventArgs e) |
| | | { |
| | | //collection |
| | | if (collectionBtn.IsSelected) |
| | | { |
| | | Shared.Common.Room.Lists[0].DeleteDevice(device.FileName); |
| | | Common.Room.CurrentRoom.GetLoveRoom().DeleteDevice(device.FileName); |
| | | collectionBtn.IsSelected = false; |
| | | } |
| | | else |
| | | { |
| | | Shared.Common.Room.Lists[0].AddDevice(device.FileName); |
| | | Common.Room.CurrentRoom.GetLoveRoom().AddDevice(device.FileName); |
| | | collectionBtn.IsSelected = true; |
| | | } |
| | | } |