void _listCollectionView_CurrentChanged(object sender, EventArgs e) { var item = ListCollectionView.CurrentItem as ItemViewModel; CurrentItemIndex = item == null ? -1 : _listItems.IndexOf(item) + 1; if (EnableBackdropsForCurrentItem) { if (item != null) { _presentationManager.SetBackdrops(item.Item); } } lock (_syncLock) { if (_selectionChangeTimer == null) { _selectionChangeTimer = new Timer(OnSelectionTimerFired, null, 300, Timeout.Infinite); } else { _selectionChangeTimer.Change(300, Timeout.Infinite); } } }
private void EnsureActiveStreamIsVisible() { var xxx = _listItems.FirstOrDefault(i => i.IsActive); var activeItemIndex = _listItems.IndexOf(_listItems.FirstOrDefault(i => i.IsActive)); Debug.WriteLine(String.Format("Ensure Active Stream is Visible {0} {1}", xxx.Name, activeItemIndex)); _presentationManager.Window.Dispatcher.InvokeAsync(() => ListCollectionView.MoveCurrentToPosition(activeItemIndex)); }
private IObservable <bool> CanMoveupObservable() { return(_right.ObserveCollectionChanged() .SelectMany(ObserveColumnProperties(_right)) .Select(x => { var selectedItems = _right.Where(y => y.IsSelected) .ToArray(); if (selectedItems.Length == 1) { var selectedIndex = _right.IndexOf(selectedItems[0]); return selectedIndex != 0; } return false; })); }
public int IndexOf(ICanvasObject child) => children.IndexOf(child);