Beispiel #1
0
        private async void SelectionState_ActiveItemChanged(object sender, EventArgs e)
        {
            if (_selection.ActiveItem == null)
            {
                return;
            }

            if (!(_selection.ActiveItem.Data is FileEntity fileEntity))
            {
                return;
            }

            var items = View.Items
                        .SelectMany(pair => pair.Items)
                        .Select(item => item.Data)
                        .OfType <FileEntity>()
                        .ToList();
            var index = items.IndexOf(fileEntity);
            await _presentation.PreviewAsync(items, index);
        }