private void EditButton_Click(object sender, RoutedEventArgs e)
 {
     if (contactsList.SelectedIndex != -1)
     {
         CreateWindow createWindow = new CreateWindow(this, contacts[contactsList.SelectedIndex]);
         createWindow.ShowDialog();
     }
 }
        private void CreateButton_Click(object sender, RoutedEventArgs e)
        {
            CreateWindow createWindow = new CreateWindow(this, null);

            createWindow.ShowDialog();
        }