private async void View_OpenItem(object sender, EventArgs e) { if (!_selection.Any()) { return; } var view = _selection.ActiveItem; if (view == null) { return; } if (view.Data is FileEntity fileEntity) { var items = View.Items .SelectMany(pair => pair.Items) .Select(item => item.Data) .OfType <FileEntity>() .ToList(); var index = items.IndexOf(fileEntity); await _presentation.OpenAsync(items, index < 0? 0 : index); } else { var query = _queryFactory.CreateQuery(view.FullPath); _queryHistory.ExecuteQuery(query); } }