/// <summary> /// A buttonclick event for completion of a customization. /// When this fires, the main window must change and the item must be added to the order /// </summary> /// <param name="sender"></param> /// <param name="e"></param> public void finishCustomizing(object sender, RoutedEventArgs e) { //add to order component text Button b = sender as Button; OrderComponent w = Window.GetWindow(this).Content as OrderComponent; Order o = w.DataContext as Order; if (!o.Contains(DataContext as IOrderItem)) { o.Add(this.DataContext as IOrderItem); } w.changePrimaryMenu("Selection"); w.OrderListView.SelectedItem = null; }