コード例 #1
0
        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);
                }
            }
        }
コード例 #2
0
        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));
        }
コード例 #3
0
        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;
            }));
        }
コード例 #4
0
 public int IndexOf(ICanvasObject child) => children.IndexOf(child);