private void SelectNext() { var cnt = LbResult.Items.Count; if (cnt < 2) { return; } var idx = LbResult.SelectedIndex; idx += 1; if (idx >= cnt) { idx = 0; } LbResult.SelectedIndex = idx; LbResult.ScrollIntoView(LbResult.Items[idx]); }
private void SelectPrev() { var cnt = LbResult.Items.Count; if (cnt < 2) { return; } var idx = LbResult.SelectedIndex; idx -= 1; if (idx < 0) { idx = cnt - 1; } LbResult.SelectedIndex = idx; LbResult.ScrollIntoView(LbResult.Items[idx]); }