当前位置: 首页>>代码示例>>C#>>正文


C# BindableCollection.Any方法代码示例

本文整理汇总了C#中BindableCollection.Any方法的典型用法代码示例。如果您正苦于以下问题:C# BindableCollection.Any方法的具体用法?C# BindableCollection.Any怎么用?C# BindableCollection.Any使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在BindableCollection的用法示例。


在下文中一共展示了BindableCollection.Any方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: SelectTagsViewModel

 public SelectTagsViewModel(ITagManager tagManager, IRecordingManager recordingManager)
 {
     _recordingManager = recordingManager;
     _tagManager = tagManager;
     Tags = new BindableCollection<Tag>();
     SelectedTags = new BindableCollection<Tag>();
     Tags.CollectionChanged += (sender, args) => HasTags = Tags.Any();
 }
开发者ID:pmacn,项目名称:VoiceRecorder.WP8,代码行数:8,代码来源:SelectTagsViewModel.cs

示例2: GetDownloadsModel

 public async Task<BindableCollection<Season>> GetDownloadsModel(bool updateDiskSpace = false)
 {
     BindableCollection<Season> seasons = new BindableCollection<Season>();
     StorageFolder userFolder;
     try
     {
         userFolder = await Windows.Storage.ApplicationData.Current.LocalFolder.GetFolderAsync(AppDataAccessor.GetUsername());
     }
     catch (FileNotFoundException e)
     {
         diskSpaceFromDownloads = new DiskSpaceResponse { totalBytes = 0, formattedSize = "0 MB" };
         return seasons;
     }
     if (userFolder != null)
     {
         try
         {
             StorageFile model = await userFolder.GetFileAsync("CompleteModel");
             string text = await Windows.Storage.FileIO.ReadTextAsync(model);
             seasons = JsonConvert.DeserializeObject<BindableCollection<Season>>(text);
         }
         catch (Exception) { }
     }
     //BindableCollection<Playlist> playlists = new BindableCollection<Playlist>();
     long totalSize = 0;
     if (seasons.Any())
     {
         foreach (Season s in seasons)
         {
             foreach (Game g in s.games)
             {
                 foreach (Category c in g.categories)
                 {
                     foreach (Playlist p in c.playlists)
                     {
                         //playlists.Add(p);
                         Playlist plFound = downloadedPlaylists.Where(u => u.playlistId == p.playlistId).FirstOrDefault();
                         if (plFound == null)
                         {
                             downloadedPlaylists.Add(p);
                         }
                         if (p.totalFilesSize != null)
                         {
                             totalSize += p.totalFilesSize;
                         }
                     }
                 }
             }
         }
     }
     if (updateDiskSpace)
     {
         diskSpaceFromDownloads = new DiskSpaceResponse{totalBytes= totalSize, formattedSize = FormatBytes(totalSize)};
     }
     return seasons;
 }
开发者ID:jwiese-ms,项目名称:hudl-win8,代码行数:56,代码来源:DownloadAccessor.cs


注:本文中的BindableCollection.Any方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。