コード例 #1
0
        private async void BT_Submit_Click(object sender, RoutedEventArgs e)
        {
            BT_Submit.IsEnabled = false;
            BT_Submit.Content   = "업로드중...";

            if (IsNameChanged())
            {
                await KakaoRequestClass.SetProfileName(TBX_Name.Text);

                MainWindow.Instance.TB_Name.Text = TBX_Name.Text;
            }

            if (IsStatusMessageChanged())
            {
                await KakaoRequestClass.SetStatusMessage(TBX_Desc.Text);
            }

            if (IsBirthdayChanged())
            {
                if (!isBirthdayExists)
                {
                    await KakaoRequestClass.DeleteBirthday();
                }
                else
                {
                    await KakaoRequestClass.SetBirthday((DateTime)DP_Birthday.SelectedDate, CB_SunDate.IsChecked == false, CB_LeapType.IsChecked == true);
                }
            }
            if (IsGenderChanged())
            {
                if (!isGenderExists)
                {
                    await KakaoRequestClass.DeleteGender();
                }
                else
                {
                    await KakaoRequestClass.SetGender(GetCurrentGenderString(), CB_PublicSex.IsChecked == true? "A" : "F");
                }
            }

            string profileRawData = await KakaoRequestClass.GetProfileData();

            MainWindow.UserProfile = JsonConvert.DeserializeObject <UserProfile.ProfileData>(profileRawData);
            Close();
        }