本文整理匯總了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)
{
}
}