/// <summary> /// 下一张 /// </summary> private void NextPic() { _currentIndex = ImgUrl.FindIndex(v => v.ChatIndex == _chatIndex); if (_currentIndex == -1) { return; } if (_currentIndex >= ImgUrl.Count - 1) { _currentIndex = ImgUrl.Count - 1; TipsText = "已经是最后一张"; TipsVisibility = Visibility.Visible; Application.Current.Dispatcher.Invoke(Timing); } else { _currentIndex++; _chatIndex = ImgUrl[_currentIndex].ChatIndex; var img = ImgUrl[_currentIndex]; if ((img.IsBurn == burnMsg.isBurnMsg.yesBurn && img.IsRead == burnMsg.IsReadImg.notRead) || (img.IsRead == burnMsg.IsReadImg.read && img.IsEffective == burnMsg.IsEffective.NotEffective)) { NextPic(); } else { _oldIndex = _currentIndex; UpdateImage(); } } }
/// <summary> /// 上一张 /// </summary> private void PrePic() { _currentIndex = ImgUrl.FindIndex(v => v.ChatIndex == _chatIndex); switch (_currentIndex) { case -1: return; case 0: TipsText = "已经是第一张"; TipsVisibility = Visibility.Visible; Application.Current.Dispatcher.Invoke(Timing); break; default: _currentIndex--; _chatIndex = ImgUrl[_currentIndex].ChatIndex; var img = ImgUrl[_currentIndex]; if ((img.IsBurn == burnMsg.isBurnMsg.yesBurn && img.IsRead == burnMsg.IsReadImg.notRead) || (img.IsRead == burnMsg.IsReadImg.read && img.IsEffective == burnMsg.IsEffective.NotEffective)) { PrePic(); } else { _oldIndex = _currentIndex; UpdateImage(); } break; } }