Beispiel #1
0
 private void ItemCollect_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 = () =>
     {
         ParentWindow.FramePop.Navigate(new SelectCollectionPage(ParentWindow,
             BeatmapQuery.FilterByFolder(page.SelectedMap.FolderName)
                 .FirstOrDefault(k => k.Version == page.SelectedMap.Version)));
     };
     ParentWindow.FramePop.Navigate(page);
 }
Beispiel #2
0
 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);
 }
Beispiel #3
0
        private void ItemCollect_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            if (ResultList.SelectedItem == null)
            {
                return;
            }
            var ok   = (BeatmapDataModel)ResultList.SelectedItem;
            var page = new DiffSelectPage(_mainWindow,
                                          _beatmapDbOperator.GetBeatmapsFromFolder(ok.GetIdentity().FolderName));

            page.Callback = () =>
            {
                _mainWindow.FramePop.Navigate(new SelectCollectionPage(
                                                  _beatmapDbOperator.GetBeatmapsFromFolder(page.SelectedMap.FolderName)
                                                  .FirstOrDefault(k => k.Version == page.SelectedMap.Version))
                                              );
            };
            _mainWindow.FramePop.Navigate(page);
        }
Beispiel #4
0
        private void ItemPlay_Click(object sender, System.Windows.RoutedEventArgs e)
        {
            if (ResultList.SelectedItem == null)
            {
                return;
            }
            var ok   = (BeatmapDataModel)ResultList.SelectedItem;
            var page = new DiffSelectPage(_mainWindow,
                                          _beatmapDbOperator.GetBeatmapsFromFolder(ok.GetIdentity().FolderName));

            page.Callback = async() =>
            {
                //await _mainWindow.PlayNewFile(Path.Combine(Domain.OsuSongPath, page.SelectedMap.FolderName,
                //      page.SelectedMap.BeatmapFileName));
                var map = _beatmapDbOperator.GetBeatmapByIdentifiable(page.SelectedMap);
                await PlayController.Default.PlayNewFile(map);

                await Services.Get <PlayerList>().RefreshPlayListAsync(PlayerList.FreshType.All, PlayListMode.RecentList);

                _mainWindow.FramePop.Navigate(null);
            };
            _mainWindow.FramePop.Navigate(page);
        }