private void Button_Ajouter_Click(object sender, RoutedEventArgs e) { var step5AddOrUpdate = new Step5AddorUpdate(); step5AddOrUpdate.PeriodicExports = ((Config)DataContext).PeriodicExports; step5AddOrUpdate.Context = ((Config)DataContext).SharepointConfig.Context; step5AddOrUpdate.OpnedForNewItem = true; var item = new PeriodicExport(); item.PeriodicChoices = PeriodicChoices; step5AddOrUpdate.DataContext = item; step5AddOrUpdate.Show(); }
private void ButtonUpdate_Click(object sender, RoutedEventArgs e) { if (lvPeriodicExports.SelectedItem != null) { var step5AddOrUpdate = new Step5AddorUpdate(); var item = (PeriodicExport)lvPeriodicExports.SelectedItem; item.PeriodicChoices = PeriodicChoices; step5AddOrUpdate.PeriodicExports = ((Config)DataContext).PeriodicExports; step5AddOrUpdate.Context = ((Config)DataContext).SharepointConfig.Context; step5AddOrUpdate.DataContext = item; step5AddOrUpdate.OpnedForNewItem = false; step5AddOrUpdate.InitComboboxes(); step5AddOrUpdate.Show(); } }