private void AddBt_Click(object sender, RoutedEventArgs e) { if ((SelectComp.SelectedItem != null) && (SelectUser.SelectedItem != null)) { object currentUser = SelectUser.SelectedItem; object currentComp = SelectComp.SelectedItem; DistributionVM newDistribution = new DistributionVM(); dvm.AddDistribution(newDistribution, currentComp, currentUser); } }
private void AddItem_Executed(object sender, ExecutedRoutedEventArgs e) { DistributionVM newDistribution = e.Parameter as DistributionVM; if ((SelectComp.SelectedItem != null) && (SelectUser.SelectedItem != null)) { object currentUser = (object)SelectUser.SelectedItem; object currentComp = (object)SelectComp.SelectedItem; dvm.AddDistribution(newDistribution, currentComp, currentUser); } }
private void RemoveButton_Click(object sender, RoutedEventArgs e) { DistributionVM deletedItem = ((Button)sender).DataContext as DistributionVM; dvm.DeleteDistribution(deletedItem); }