Esempio n. 1
0
        private void uxComponentList_MouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            var window = new ComponentWindow();

            window.Component = _selectedComponent;
            if (window.ShowDialog() == true)
            {
                App.ComponentRepository.Update(window.Component.ToRepositoryModel());
                LoadContacts();
            }
        }
Esempio n. 2
0
        private void WindowMainMENU_FileModify_Click(object sender, RoutedEventArgs e)
        {
            var window = new ComponentWindow();

//            window.Component = _selectedComponent;    // original code
            window.Component = ((ComponentModel)_selectedComponent.Clone());   // GET A CLONE OF ITSELF TO THE WINDOW
            if (window.ShowDialog() == true)
            {
                App.ComponentRepository.Update(window.Component.ToRepositoryModel());
                LoadContacts();
            }
        }
Esempio n. 3
0
//        private void uxFileNew_Click(object sender, RoutedEventArgs e)
//        {
//            var window = new ComponentWindow();
//
//            if (window.ShowDialog() == true)
//            {
//                var uiComponentModel = window.Component;
//
//                var repositoryContactModel = uiComponentModel.ToRepositoryModel();
//
//                App.ComponentRepository.Add(repositoryContactModel);
//
//                // OR
//                //App.ContactRepository.Add(window.Contact.ToRepositoryModel());
//
//                LoadContacts();
//            }
//        }
        private void WindowMainMENU_FileNew_Click(object sender, RoutedEventArgs e)
        {
            var window = new ComponentWindow();

            if (window.ShowDialog() == true)
            {
                var uiComponentModel         = window.Component;
                var repositoryComponentModel = uiComponentModel.ToRepositoryModel();
                App.ComponentRepository.Add(repositoryComponentModel);
                // OR
                //App.ComponentRepository.Add(window.Component.ToRepositoryModel());

                LoadContacts();
            }
        }