| | |
| | | { |
| | | |
| | | public Action<string> FloorAction; |
| | | /// <summary> |
| | | /// 是否切换为当前楼层 |
| | | /// </summary> |
| | | public bool changeFloor = true; |
| | | /// <summary> |
| | | /// 当前传过来的floorid |
| | | /// </summary> |
| | | public string CurFloorId = string.Empty; |
| | | |
| | | public bool changeFloor; |
| | | Dialog dialogBackground; |
| | | |
| | | /// <summary> |
| | | /// Init |
| | | /// </summary> |
| | | public void Init(int x,int y,CommonForm.Direction direction=CommonForm.Direction.Left) |
| | | { |
| | | var dialog = new FrameLayout() |
| | | dialogBackground = new Dialog |
| | | { |
| | | BackgroundColor = ZigbeeColor.Current.GXCDailogBackGroundColor |
| | | }; |
| | | AddChidren(dialog); |
| | | dialogBackground.Show(); |
| | | var dialog = new FrameLayout() |
| | | { |
| | | }; |
| | | dialogBackground.AddChidren(dialog); |
| | | |
| | | dialog.MouseUpEventHandler += (sender, e) => |
| | | { |
| | | RemoveFromParent(); |
| | | RemoveView(); |
| | | }; |
| | | |
| | | var bg = new Button |
| | |
| | | frow.Tag = floor.Key; |
| | | frow.Init("Floor/Floor.png", "Floor/FloorSelected.png", floor.Value); |
| | | verticalScrolView.AddChidren(frow); |
| | | if (Config.Instance.Home.CurrentFloorId == floor.Key) |
| | | |
| | | if(string.IsNullOrEmpty(CurFloorId)) |
| | | { |
| | | frow.IsSelected = true; |
| | | if (Config.Instance.Home.CurrentFloorId == floor.Key) |
| | | { |
| | | frow.IsSelected = true; |
| | | } |
| | | } |
| | | else |
| | | { |
| | | if (CurFloorId == floor.Key) |
| | | { |
| | | frow.IsSelected = true; |
| | | } |
| | | } |
| | | |
| | | frow.ClickBtn.MouseUpEventHandler += SelectFloor_MouseUpEvent; |
| | | frow.ButtonClickEvent += SelectFloor_MouseUpEvent; |
| | | } |
| | | |
| | | /// <summary> |
| | |
| | | /// <param name="mouseEventArgs"></param> |
| | | private void SelectFloor_MouseUpEvent(object sender,MouseEventArgs mouseEventArgs) |
| | | { |
| | | ((sender as Button).Parent as CommonForm.LeftIconButtonRow).IsSelected = true; |
| | | (sender as CommonForm.LeftIconButtonRow).IsSelected = true; |
| | | if(changeFloor) |
| | | { |
| | | Config.Instance.Home.CurrentFloorId = (sender as Button).Tag.ToString(); |
| | | Config.Instance.Home.CurrentFloorId = (sender as CommonForm.LeftIconButtonRow).Tag.ToString(); |
| | | Config.Instance.Home.Save(); |
| | | Common.Room.RefreshRoomListView(); |
| | | } |
| | | |
| | | FloorAction?.Invoke((sender as Button).Tag.ToString()); |
| | | RemoveView(); |
| | | FloorAction?.Invoke((sender as CommonForm.LeftIconButtonRow).Tag.ToString()); |
| | | |
| | | } |
| | | |
| | | /// <summary> |
| | | /// RemoveView |
| | | /// </summary> |
| | | private void RemoveView() |
| | | { |
| | | dialogBackground.Close(); |
| | | RemoveFromParent(); |
| | | } |
| | | } |