public CollectionPage(MainWindow mainWindow, Collection collectionInfo) { InitializeComponent(); _mainWindow = mainWindow; ViewModel = (CollectionPageViewModel)this.DataContext; ViewModel.CollectionInfo = collectionInfo; var infos = (List <MapInfo>)DbOperate.GetMapsFromCollection(collectionInfo); _entries = BeatmapQuery.GetBeatmapsByIdentifiable(infos, false); ViewModel.Beatmaps = new NumberableObservableCollection <BeatmapDataModel>(_entries.ToDataModels(false)); }
private void ItemPlay_Click(object sender, System.Windows.RoutedEventArgs e) { if (ResultList.SelectedItem == null) return; var ok = (BeatmapDataModel)ResultList.SelectedItem; var page = new DiffSelectPage(ParentWindow, BeatmapQuery.FilterByFolder(ok.GetIdentity().FolderName)); page.Callback = async () => { //await ParentWindow.PlayNewFile(Path.Combine(Domain.OsuSongPath, page.SelectedMap.FolderName, // page.SelectedMap.BeatmapFileName)); var map = BeatmapQuery.GetBeatmapsByIdentifiable(page.SelectedMap); await ParentWindow.PlayNewFile(map); await InstanceManage.GetInstance<PlayerList>().RefreshPlayListAsync(PlayerList.FreshType.All, PlayListMode.RecentList); ParentWindow.FramePop.Navigate(null); }; ParentWindow.FramePop.Navigate(page); }