private void OnContactListException(object sender, GetContactListExceptionEventArgs e)
        {
            Dispatcher.BeginInvoke(() => {
                if(SystemTray.ProgressIndicator != null)
                    SystemTray.ProgressIndicator.IsVisible = false;

                if (Cinderella.CinderellaCore.ContactList.Count == 0)
                {
                    StatusLabel.Text = AppResources.ContactsLoadingErrorText;
                    StatusLabel.Visibility = Visibility.Visible;
                }

            });
        }
        public async void GetContactListAsync(int page, int perPage, Dictionary<string, string> parameters = null)
        {
            if (isLoadingContactList)
                return;

            isLoadingContactList = true;

            string timestamp = DateTimeUtils.GetTimestamp();
            string nonce = Guid.NewGuid().ToString().Replace("-", null);

            Dictionary<string, string> paramDict = new Dictionary<string, string>();
            paramDict["method"] = "flickr.contacts.getList";
            paramDict["format"] = "json";
            paramDict["nojsoncallback"] = "1";
            paramDict["oauth_consumer_key"] = consumerKey;
            paramDict["oauth_nonce"] = nonce;
            paramDict["oauth_signature_method"] = "HMAC-SHA1";
            paramDict["oauth_timestamp"] = timestamp;
            paramDict["oauth_token"] = AccessToken;
            paramDict["oauth_version"] = "1.0";
            paramDict["page"] = page.ToString();
            paramDict["per_page"] = perPage.ToString();

            if (parameters != null)
            {
                foreach (var entry in parameters)
                {
                    paramDict[entry.Key] = entry.Value;
                }
            }

            string paramString = GenerateParamString(paramDict);
            string signature = GenerateSignature("GET", AccessTokenSecret, "https://api.flickr.com/services/rest", paramString);
            string requestUrl = "https://api.flickr.com/services/rest?" + paramString + "&oauth_signature=" + signature;
            HttpWebResponse response = await DispatchRequest("GET", requestUrl, null).ConfigureAwait(false);
            using (StreamReader reader = new StreamReader(response.GetResponseStream()))
            {
                isLoadingContactList = false;

                if (response.StatusCode != HttpStatusCode.OK)
                {
                    var exceptionEvt = new GetContactListExceptionEventArgs();
                    exceptionEvt.Page = page;
                    exceptionEvt.PerPage = perPage;
                    GetContactListException.DispatchEvent(this, exceptionEvt);

                    HandleHTTPException(response);
                    return;
                }

                string jsonString = await reader.ReadToEndAsync().ConfigureAwait(false);
                if (!TryHandleResponseException(jsonString, 
                    () => { 
                        GetContactListAsync(page, perPage, parameters); 
                    }, 
                    () => {
                        var exceptionEvt = new GetContactListExceptionEventArgs();
                        exceptionEvt.Page = page;
                        exceptionEvt.PerPage = perPage;
                        GetContactListException.DispatchEvent(this, exceptionEvt);
                }))
                    return;

                GetContactListEventArgs args = new GetContactListEventArgs();
                args.Page = page;
                args.PerPage = perPage;
                args.Response = jsonString;
                ContactListReturned.DispatchEvent(this, args);
            }
        }