Example #1
0
        private void GoToSource(object obj)
        {
            var sourceIndex = obj as int?;

            if (sourceIndex.HasValue)
            {
                --sourceIndex;

                if (sourceIndex < 0 || sourceIndex > _sourcesViewModel.Items.Count)
                {
                    return;
                }

                _sourcesViewModel.ActivateItem(_sourcesViewModel.Items[sourceIndex.Value]);
            }
        }
Example #2
0
        private void GoToSource(object obj)
        {
            var sourceIndex = obj as int?;

            if (sourceIndex.HasValue)
            {
                --sourceIndex;

                var items = _sourcesViewModel.Items.Where(vm => !(vm is SourceSeparatorViewModel)).ToList();
                if (sourceIndex < 0 || sourceIndex > items.Count)
                {
                    return;
                }

                _sourcesViewModel.ActivateItem(items[sourceIndex.Value]);
            }
        }
Example #3
0
        private void GoToSource(object obj)
        {
            var sourceIndex = obj as int?;

            if (sourceIndex.HasValue)
            {
                --sourceIndex;

                if (sourceIndex < 0 || sourceIndex > _sourcesViewModel.Items.Count)
                {
                    return;
                }

#if NETFRAMEWORK
                _sourcesViewModel.ActivateItem(_sourcesViewModel.Items[sourceIndex.Value]);
#else
                _sourcesViewModel.ActivateItemAsync(_sourcesViewModel.Items[sourceIndex.Value]).GetAwaiter().GetResult();
#endif
            }
        }