private void highlightPrev() { Dispatcher.BeginInvoke(new Action(delegate() { int selectedIndex = -2; for (int i = this.layoutList.Children.Count - 1; i >= 0; i--) { LayoutSelectionRow row = this.layoutList.Children[i] as LayoutSelectionRow; if (row.isSelected()) { selectedIndex = i; row.setSelected(false); } if (i == selectedIndex - 1) { row.setSelected(true); } } if (selectedIndex == 0) { LayoutSelectionRow row = this.layoutList.Children[this.layoutList.Children.Count - 1] as LayoutSelectionRow; row.setSelected(true); } else if (selectedIndex == -2)//If no row was found selected { LayoutSelectionRow row = this.layoutList.Children[this.layoutList.Children.Count - 1] as LayoutSelectionRow; row.setSelected(true); } })); }
private void selectHighlighted() { Dispatcher.BeginInvoke(new Action(delegate() { for (int i = this.layoutList.Children.Count - 1; i >= 0; i--) { LayoutSelectionRow row = this.layoutList.Children[i] as LayoutSelectionRow; if (row.isSelected()) { this.Select_Layout(row.getFilename()); } } })); }