本文整理汇总了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();
}
示例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;
}