//handles edit profile event private void EditProfile_ButtonClicked(object sender, ProfileUpdateEventArgs e) { Consoletxtblock.Text += "Edit Profile Button Clicked..." + Environment.NewLine; List <String> items = new List <String>(); items.Add(e.UserName); items.Add(e.RealName); items.Add(e.Country); items.Add(e.District); items.Add(e.City); items.Add(e.Address); items.Add(e.PayMethod); items.Add(e.AccountInfo); //update profile listbox if (ProfileLB.ItemsSource == null) { ProfileLB.Items.Clear(); // clear item source ProfileLB.ItemsSource = items; } else { ProfileLB.ItemsSource = null; ProfileLB.Items.Clear(); // clear item source ProfileLB.ItemsSource = items; } }
private void AccountDetails_ButtonClicked(object sender, ProfileUpdateEventArgs e) { string username = "******" + e.UserName + Environment.NewLine; string realname = "RealName: " + e.RealName + Environment.NewLine; string country = "Country: " + e.Country + Environment.NewLine; string district = "District: " + e.District + Environment.NewLine; string city = "City: " + e.City + Environment.NewLine; string address = "Address: " + e.Address + Environment.NewLine; string paymethod = "PayMethod: " + e.PayMethod + Environment.NewLine; string accountinfo = "Account Info: " + e.AccountInfo + Environment.NewLine; string msg = username + realname + country + district + city + address + paymethod + accountinfo; MessageBox.Show(msg); //show message in a message box; }
private void ApplyChanges(object sender, RoutedEventArgs e) { string sUserName = txtUserName.Text; string sRealName = txtRealName.Text; string sCountry = txtCountry.Text; string sDistrict = txtDistrict.Text; string sCity = txtCity.Text; string sAddress = txtAddress.Text; string sPayMethod = GetPayMethod(); string sAccountInfo = txtAccountInfo.Text; //instance the event args and pass it each value ProfileUpdateEventArgs args = new ProfileUpdateEventArgs(sUserName, sRealName, sCountry, sDistrict, sCity, sAddress, sPayMethod, sAccountInfo); //raise the event with the updated arguments ProfileUpdated(this, args); //close window; this.Close(); }
private void PayMethod_ButtonClicked(object sender, ProfileUpdateEventArgs e) { string paymethod = "PayMethod: " + e.PayMethod; MessageBox.Show(paymethod); //show message in a message box; }