public bool CheckCredentials()
        {
            var roamingSettings = _applicationData.RoamingSettings;

            if (roamingSettings.Values.ContainsKey("username") &&
                roamingSettings.Values.ContainsKey("password"))
            {
                var username = roamingSettings.Values["username"] as string;
                var password = roamingSettings.Values["password"] as string;

                if (string.IsNullOrWhiteSpace(username) ||
                    string.IsNullOrWhiteSpace(password))
                {
                    Debug.WriteLine("No credentials.");

                    return(false);
                }

                ReadItLaterApi = new ReadItLaterApi.Metro.ReadItLaterApi(username, password);

                return(true);
            }

            Debug.WriteLine("No credentials.");

            return(false);
        }
        private async void CreateButton_Click(object sender, RoutedEventArgs e)
        {
            if (!App.HasConnectivity)
            {
                var messageDialog = new Windows.UI.Popups.MessageDialog("You can't create a Read it Later account until you have Internet access. Please try again once you're connected to the Internet.", "Error");

                await messageDialog.ShowAsync();

                return;
            }

            if (!string.IsNullOrWhiteSpace(passwordPasswordBox.Password) &&
                !string.IsNullOrWhiteSpace(usernameTextBox.Text))
            {
                var username = usernameTextBox.Text;
                var password = passwordPasswordBox.Password;

                var api = new ReadItLaterApi.Metro.ReadItLaterApi(username, password);

                if (await api.CreateAccount())
                {
                    SaveSettings(usernameTextBox.Text.Trim(), passwordPasswordBox.Password);

                    Hide();
                }
                else
                {
                    var messageDialog = new Windows.UI.Popups.MessageDialog("There was an error creating your Read it Later account. Please try again later.", "Error");

                    await messageDialog.ShowAsync();
                }
            }
        }
        public bool CheckCredentials()
        {
            var roamingSettings = _applicationData.RoamingSettings;

            if (roamingSettings.Values.ContainsKey("username") &&
                roamingSettings.Values.ContainsKey("password"))
            {
                var username = roamingSettings.Values["username"] as string;
                var password = roamingSettings.Values["password"] as string;

                if (string.IsNullOrWhiteSpace(username) ||
                    string.IsNullOrWhiteSpace(password))
                {
                    Debug.WriteLine("No credentials.");

                    return false;
                }
                
                ReadItLaterApi = new ReadItLaterApi.Metro.ReadItLaterApi(username, password);

                return true;
            }

            Debug.WriteLine("No credentials.");

            return false;
        }
        private async void CreateButton_Click(object sender, RoutedEventArgs e)
        {
            if (!App.HasConnectivity)
            {
                var messageDialog = new Windows.UI.Popups.MessageDialog("You can't create a Read it Later account until you have Internet access. Please try again once you're connected to the Internet.", "Error");

                await messageDialog.ShowAsync();

                return;
            }

            if (!string.IsNullOrWhiteSpace(passwordPasswordBox.Password) &&
                !string.IsNullOrWhiteSpace(usernameTextBox.Text))
            {
                var username = usernameTextBox.Text;
                var password = passwordPasswordBox.Password;

                var api = new ReadItLaterApi.Metro.ReadItLaterApi(username, password);

                if (await api.CreateAccount())
                {
                    SaveSettings(usernameTextBox.Text.Trim(), passwordPasswordBox.Password);

                    Hide();
                }
                else
                {
                    var messageDialog = new Windows.UI.Popups.MessageDialog("There was an error creating your Read it Later account. Please try again later.", "Error");
    
                    await messageDialog.ShowAsync();
                }
            }
        }