本文整理汇总了C#中AsyncObservableCollection.Any方法的典型用法代码示例。如果您正苦于以下问题:C# AsyncObservableCollection.Any方法的具体用法?C# AsyncObservableCollection.Any怎么用?C# AsyncObservableCollection.Any使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AsyncObservableCollection
的用法示例。
在下文中一共展示了AsyncObservableCollection.Any方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: LoadAlbums
private void LoadAlbums()
{
try
{
String url = string.Format("/{0}/albums", SelectedPage.Split(new []{"||"},StringSplitOptions.RemoveEmptyEntries)[0]);
string token = SelectedPage.Split(new[] {"||"}, StringSplitOptions.RemoveEmptyEntries)[1];
var client = new FacebookClient
{
AccessToken = AccessToken,
AppId = ClientId,
AppSecret = ClientSecret
};
Albums = new AsyncObservableCollection<ValuePair>();
do
{
dynamic albums = client.Get(url, new { limit = 25, offset = 0 });
foreach (dynamic data in albums.data)
{
Albums.Add(new ValuePair() { Value = data.id+"||"+token, Name = data.name });
}
if (albums.paging != null && !String.IsNullOrEmpty(albums.paging.next))
url = albums.paging.next;
else
url = String.Empty;
} while (!String.IsNullOrEmpty(url));
if (string.IsNullOrEmpty(SelectedAlbum) && Albums.Any())
{
SelectedAlbum = Albums[0].Value;
}
}
catch (Exception)
{
}
}