private void HandleDoubleClick(object sender, MouseButtonEventArgs e)
 {
     if (listBox.SelectedItem != null)
     {
         modify_Activ window = new modify_Activ(list[listBox.SelectedIndex], this, listBox.SelectedIndex);
         window.Owner = MainWindow.GetWindow(this);
         window.Show();
     }
 }
        private void modif_Click(object sender, RoutedEventArgs e)
        {
            Button btn = (Button)sender;

            if (btn != null)
            {
                var st = FindParent <Grid>(btn); //stackpanel as we have added item as stackpanel.
                if (st != null)
                {
                    int          index = listBox.Items.IndexOf(st);
                    modify_Activ win   = new modify_Activ(list[index], this, index);
                    win.Show();
                }
            }
        }