Ejemplo n.º 1
0
        private void uxFileNew_Click(object sender, RoutedEventArgs e)
        {
            var window = new ContactWindow();

            if (window.ShowDialog() == true)
            {
                App.ContactRepository.Add(window.Contact.ToRepositoryModel());
                LoadContacts();
            }
        }
Ejemplo n.º 2
0
        private void uxFileChange_Click(object sender, RoutedEventArgs e)
        {
            var window = new ContactWindow();

            window.Contact = ((ContactModel)selectedContact.Clone());

            if (window.ShowDialog() == true)
            {
                App.ContactRepository.Update(window.Contact.ToRepositoryModel());
                LoadContacts();
            }
        }
Ejemplo n.º 3
0
        private void uxFileChange_Click(object sender, MouseButtonEventArgs e)
        {
            var window = new ContactWindow();

            window.Contact = ((ContactModel)selectedContact.Clone());   // GET A CLONE OF ITSELF TO THE WINDOW

            if (window.ShowDialog() == true)
            {
                App.ContactRepository.Update(window.Contact.ToRepositoryModel());
                LoadContacts();
            }
        }
Ejemplo n.º 4
0
        private void EditContact()
        {
            var window = new ContactWindow();

            window.Contact = selectedContact.Clone();

            if (window.ShowDialog() == true)
            {
                App.ContactRepository.Update(window.Contact.ToRepositoryModel());
                LoadContacts();
            }
        }
Ejemplo n.º 5
0
        private void uxFileChange_Click(object sender, RoutedEventArgs e)
        {
            // Perform a shallow copy of p1 and assign it to p2.
            var window = new ContactWindow();

            window.Contact = selectedContact.Clone();

            if (window.ShowDialog() == true)
            {
                App.ContactRepository.Update(window.Contact.ToRepositoryModel());
                LoadContacts();
            }
        }
Ejemplo n.º 6
0
        private void uxFileChange_Click(object sender, RoutedEventArgs e)
        {
            var window = new ContactWindow();

            window.Contact = selectedContact;
            if (window.ShowDialog() == true)
            {
                var uiContactModel = window.Contact;

                var repositoryContactModel = uiContactModel.ToRepositoryModel();

                App.ContactRepository.Update(repositoryContactModel);
            }
        }
Ejemplo n.º 7
0
        private void uxFileNew_Click(object sender, RoutedEventArgs e)
        {
            var window = new ContactWindow();

            if (window.ShowDialog() == true)
            {
                var uiContactModel = window.Contact;

                var repositoryContactModel = uiContactModel.ToRepositoryModel();

                App.ContactRepository.Add(repositoryContactModel);

                // OR
                //App.ContactRepository.Add(window.Contact.ToRepositoryModel());
            }
        }
Ejemplo n.º 8
0
        private void uxFileNew_Click(object sender, RoutedEventArgs e)
        {
            var window = new ContactWindow();

            if (window.ShowDialog() == true)
            {
                var uiContactModel = window.Contact;

                var repositoryContactModel = uiContactModel.ToRepositoryModel();

                App.ContactRepository.Add(repositoryContactModel);

                // OR
                //App.ContactRepository.Add(window.Contact.ToRepositoryModel());

                LoadContacts(); //When adding an element call on load contacts to update, to show up
            }
        }