private void OnDivisionClicked(string division, int channelIndex = -1) { int iDivision; if (int.TryParse(division, out iDivision)) { ENUM_DIVISIONS newDivision = ENUM_DIVISIONS.NONE; switch (iDivision) { case (int)ENUM_DIVISIONS.DIVISION_1: case (int)ENUM_DIVISIONS.DIVISION_4: case (int)ENUM_DIVISIONS.DIVISION_9: case (int)ENUM_DIVISIONS.DIVISION_16: case (int)ENUM_DIVISIONS.DIVISION_36: case (int)ENUM_DIVISIONS.DIVISION_64: newDivision = (ENUM_DIVISIONS)iDivision; break; } if (newDivision != ENUM_DIVISIONS.NONE && newDivision != Global.curDivision) { ENUM_DIVISIONS oldDivision = Global.curDivision; Global.curDivision = newDivision; OnPropertyChanged("IsSelectedDivision1"); OnPropertyChanged("IsSelectedDivision4"); OnPropertyChanged("IsSelectedDivision9"); OnPropertyChanged("IsSelectedDivision16"); OnPropertyChanged("IsSelectedDivision36"); OnPropertyChanged("IsSelectedDivision64"); OnDivisionChanged(oldDivision, newDivision, channelIndex); } } }
private void OnDivisionChanged(ENUM_DIVISIONS oldDivision, ENUM_DIVISIONS newDivision, int channelIndex = -1) { int index = 0; foreach (var channelContentView in ChannelPanelList) { channelContentView.startChannelIndex = index * (int)Global.curDivision; channelContentView.ReloadGUI(); index++; } if (channelIndex != -1 && channelIndex < ChannelPanelList.Count) { Global.curChannelActive = channelIndex; } if (Global.curChannelActive != -1) { CurrentPanelIndex = Global.curChannelActive / (int)newDivision; } IsFullScreenChannel = (newDivision == ENUM_DIVISIONS.DIVISION_1); }