private void btnSearch_Click(object sender, RoutedEventArgs e) { //_searchWindow.AssignSearchCriteria(MyViewModel); _searchWindow = new RouteCardSearchResultChild(MyViewModel, false); _searchWindow.SubmitSearchAction += searchWindow_SubmitSearchAction; _searchWindow.Show(); FormMode = FormMode.Search; SwitchFormMode(FormMode); }
private void TryToOpenChild() { try { var myViewModel = (LayoutRoot.DataContext as RouteCardHeaderViewModel); if (myViewModel != null && myViewModel.TransactionType == 9) { var child = new RouteCardSearchResultChild(myViewModel, true); child.Show(); } else { _childStyleChooser = new RouteCard_StyleChooserChild((int)CmbRouteGroup.SelectedValue, CmbDirection.SelectedIndex, (int)cmbRouteType.SelectedValue, myViewModel != null && myViewModel.BoolCuttingQty, myViewModel); _childStyleChooser.Show(); _childStyleChooser.SubmitAction += _ChildStyleChooser_SubmitAction; } } catch (Exception) { //if the data is not yet loaded notify the user MessageBox.Show("Data is not yet loaded; this could be due to a slow connection!\nPlease wait a little while and try again!", "", MessageBoxButton.OK); } }