Exemple #1
0
        public static void WriteContacBook(ContactBook contactBook)
        {
            var contactBookData =
                $"Full Name: {contactBook.FullName}\n" +
                $"Email: {contactBook.Email} \n" +
                $"Phone Number: {contactBook.PhoneNumber}\n" +
                $"Address: {contactBook.Address} \n";

            FileHelper.WriteTextFileAsync(TEXT_FILE_NAME, contactBookData);
        }
        private void Save_Click(object sender, RoutedEventArgs e)
        {
            var contactBook = new ContactBook
            {
                FullName    = fullName.Text,
                Email       = email.Text,
                PhoneNumber = phoneNumber.Text,
                Address     = address.Text,
                //ListBox = listBox.ItemeSources
            };

            ContactBook.WriteContacBook(contactBook);


            this.Frame.Navigate(typeof(AddContact));
        }
 private void show_Click(object sender, RoutedEventArgs e)
 {
     ContactBook.ReadContent();
 }