private void OnSelectProfileColor(ProfileColorViewModel preferredColor) { foreach (var pc in ProfileColors.Where(pc => pc.IsSelected && pc != preferredColor)) { pc.IsSelected = false; } preferredColor.IsSelected = true; }
private async Task OnLoginAsync() { string color = ProfileColors.Single(pc => pc.IsSelected).Color; await LoginService.LoginAsync(UserName, color); await App.Repository.AddAsync(new CircleMessage { Author = UserName, Color = color, IsRoot = true, Text = $"{UserName} entered the circle!", }); }
/// <summary> /// Updates the color scheme of the Profile page /// </summary> /// <param name="profile">Enum of Profile sections</param> /// <param name="hexColor">3 or 6 character HEX code</param> /// <returns></returns> public bool UpdateProfileColors(ProfileColors profile, string hexColor) { string response = string.Empty; string url = string.Empty; if (profile == ProfileColors.BackgroundColor) url = string.Format("http://api.twitter.com/1/account/update_profile_colors.xml?profile_background_color={0}", hexColor); else if (profile == ProfileColors.LinkColor) url = string.Format("http://api.twitter.com/1/account/update_profile_colors.xml?profile_link_color={0}", hexColor); else if (profile == ProfileColors.SidebarBorderColor) url = string.Format("http://api.twitter.com/1/account/update_profile_colors.xml?profile_sidebar_border_color={0}", hexColor); else if (profile == ProfileColors.SidebarFillColor) url = string.Format("http://api.twitter.com/1/account/update_profile_colors.xml?profile_sidebar_fill_color={0}", hexColor); else if (profile == ProfileColors.TextColor) url = string.Format("http://api.twitter.com/1/account/update_profile_colors.xml?profile_text_color={0}", hexColor); if (!IsOAuthEnabled) response = Post(url); else response = OAuthPostRequest(url, ""); return (response.Contains("user")); }