Пример #1
0
        private async void Button_Click(object sender, RoutedEventArgs e)
        {
            var contact = new Contact
            {
                FirstName   = firstnameText.Text,
                LastName    = lastnameText.Text,
                PhoneNumber = phonenumberText.Text,
                Email       = emailText.Text,
                Group       = groupText.Text,
                Work        = WorkText.Text,
                Address     = AddressText.Text
            };


            Contact.WriteContact(contact);

            if (contact.FirstName != "")
            {
                var dialog = new MessageDialog("You have succesfully added your contact information");
                await dialog.ShowAsync();
            }

            else
            {
                var dialog = new MessageDialog("You have to input the contact's First Name Before adding contact");

                await dialog.ShowAsync();
            }
        }
Пример #2
0
        private void Button_Click(object sender, RoutedEventArgs e)
        {
            var contact = new Contact
            {
                First = firstnamelabel.Text,
                Last  = lastnameText.Text
            };

            Contact.WriteContact(contact);
        }
Пример #3
0
        private void Add_Click(object sender, RoutedEventArgs e)
        {
            var contact = new Contact
            {
                FirstName   = firstNameText.Text,
                LastName    = LastNameText.Text,
                PhoneNumber = phoneNumberText.Text
            };

            Contact.WriteContact(contact);
        }