Пример #1
0
        //Methods
        //Add new contact || Edit mode turned off
        public void Button_AddContact(object sender, RoutedEventArgs e)
        {
            //Open Window
            var window = new ConnectedWindow { Owner = this };

            //Set new window to Edit Mode Off
            window.IsEditMode = false;

            //Load Entry here
            Contact newContact = new Contact();

            //Load new contact with injection function
            window.LoadEntry(newContact);

            //Open Dialog
            window.ShowDialog();
        }
        //Methods

        //Add new contact || Edit mode turned off
        public void Button_AddContact(object sender, RoutedEventArgs e)
        {
            //Open Window
            var window = new ConnectedWindow {
                Owner = this
            };

            //Set new window to Edit Mode Off
            window.IsEditMode = false;

            //Load Entry here
            Contact newContact = new Contact();

            //Load new contact with injection function
            window.LoadEntry(newContact);

            //Open Dialog
            window.ShowDialog();
        }
        //Edit mode turned on
        //Open edit mode window
        public void doubleClickEvent()
        {
            try
            {
                //Cast
                //Create a refrence Object, save the refrence object as the selected item
                Contact selected = (Contact)dataGrid_ContactList.SelectedItem;

                //Open Window
                var window = new ConnectedWindow {
                    Owner = this
                };
                window.IsEditMode = true;
                window.LoadEntry(selected);
                window.ShowDialog();
            }

            //If no selection is made, or error occurs...
            catch (Exception)
            {
                MessageBox.Show("Please ensure that you have selected a contact to edit.  Contact System Admin of problem persists");
            }
        }
Пример #4
0
        //Edit mode turned on
        //Open edit mode window
        public void doubleClickEvent()
        {
            try
            {
                //Cast
                //Create a refrence Object, save the refrence object as the selected item
                Contact selected = (Contact)dataGrid_ContactList.SelectedItem;

                //Open Window
                var window = new ConnectedWindow { Owner = this };
                window.IsEditMode = true;
                window.LoadEntry(selected);
                window.ShowDialog();
            }

            //If no selection is made, or error occurs...
            catch(Exception)
            {
                MessageBox.Show("Please ensure that you have selected a contact to edit.  Contact System Admin of problem persists");
            }
        }