private void ExChildWindow_Loaded(object sender, RoutedEventArgs e) { this.LayoutRoot.Children.Clear(); switch (Common.gDataFormType) { case Common.geDataFormType.OrderDetail: Utl_DataFormOrder utlOrder = new Utl_DataFormOrder(); utlOrder._entityH = (EntityOrderH)this._entityH; utlOrder._entityListD = (ObservableCollection<EntityOrderD>)this._entityListD; this.LayoutRoot.Children.Add(utlOrder); break; case Common.geDataFormType.EstimateDetail: Utl_DataFormEstimate utlEstimate = new Utl_DataFormEstimate(); utlEstimate._entityH = (EntityEstimateH)this._entityH; utlEstimate._entityListD = (ObservableCollection<EntityEstimateD>)this._entityListD; this.LayoutRoot.Children.Add(utlEstimate); break; case Common.geDataFormType.SalesDetail: Utl_DataFormSales utlSales = new Utl_DataFormSales(); utlSales._entityH = (EntitySalesH)this._entityH; utlSales._entityListD = (ObservableCollection<EntitySalesD>)this._entityListD; this.LayoutRoot.Children.Add(utlSales); break; case Common.geDataFormType.ReceiptDetail: Utl_DataFormReceipt utlReceipt = new Utl_DataFormReceipt(); utlReceipt._entityH = (EntityReceiptH)this._entityH; utlReceipt._entityListD = (ObservableCollection<EntityReceiptD>)this._entityListD; this.LayoutRoot.Children.Add(utlReceipt); break; case Common.geDataFormType.PurchaseOrderDetail: Utl_DataFormPurchaseOrder utlPurchaseOrder = new Utl_DataFormPurchaseOrder(); utlPurchaseOrder._entityH = (EntityPurchaseOrderH)this._entityH; utlPurchaseOrder._entityListD = (ObservableCollection<EntityPurchaseOrderD>)this._entityListD; this.LayoutRoot.Children.Add(utlPurchaseOrder); break; case Common.geDataFormType.PurchaseDetail: Utl_DataFormPurchase utlPurchase = new Utl_DataFormPurchase(); utlPurchase._entityH = (EntityPurchaseH)this._entityH; utlPurchase._entityListD = (ObservableCollection<EntityPurchaseD>)this._entityListD; this.LayoutRoot.Children.Add(utlPurchase); break; case Common.geDataFormType.PaymentCashDetail: Utl_DataFormPaymentCash utlPaymentCash = new Utl_DataFormPaymentCash(); utlPaymentCash._entityH = (EntityPaymentCashH)this._entityH; utlPaymentCash._entityListD = (ObservableCollection<EntityPaymentCashD>)this._entityListD; this.LayoutRoot.Children.Add(utlPaymentCash); break; default: break; } //this.listDisplayTabIndex = ExVisualTreeHelper.GetDisplayTabIndex(this.GridMaster); // Tab Index 保持 }
private void ExChildWindow_Loaded(object sender, RoutedEventArgs e) { this.LayoutRoot.Children.Clear(); switch (Common.gDataFormType) { case Common.geDataFormType.OrderDetail: Utl_DataFormOrder utlOrder = new Utl_DataFormOrder(); utlOrder._entityH = (EntityOrderH)this._entityH; utlOrder._entityListD = (ObservableCollection <EntityOrderD>) this._entityListD; this.LayoutRoot.Children.Add(utlOrder); break; case Common.geDataFormType.EstimateDetail: Utl_DataFormEstimate utlEstimate = new Utl_DataFormEstimate(); utlEstimate._entityH = (EntityEstimateH)this._entityH; utlEstimate._entityListD = (ObservableCollection <EntityEstimateD>) this._entityListD; this.LayoutRoot.Children.Add(utlEstimate); break; case Common.geDataFormType.SalesDetail: Utl_DataFormSales utlSales = new Utl_DataFormSales(); utlSales._entityH = (EntitySalesH)this._entityH; utlSales._entityListD = (ObservableCollection <EntitySalesD>) this._entityListD; this.LayoutRoot.Children.Add(utlSales); break; case Common.geDataFormType.ReceiptDetail: Utl_DataFormReceipt utlReceipt = new Utl_DataFormReceipt(); utlReceipt._entityH = (EntityReceiptH)this._entityH; utlReceipt._entityListD = (ObservableCollection <EntityReceiptD>) this._entityListD; this.LayoutRoot.Children.Add(utlReceipt); break; case Common.geDataFormType.PurchaseOrderDetail: Utl_DataFormPurchaseOrder utlPurchaseOrder = new Utl_DataFormPurchaseOrder(); utlPurchaseOrder._entityH = (EntityPurchaseOrderH)this._entityH; utlPurchaseOrder._entityListD = (ObservableCollection <EntityPurchaseOrderD>) this._entityListD; this.LayoutRoot.Children.Add(utlPurchaseOrder); break; case Common.geDataFormType.PurchaseDetail: Utl_DataFormPurchase utlPurchase = new Utl_DataFormPurchase(); utlPurchase._entityH = (EntityPurchaseH)this._entityH; utlPurchase._entityListD = (ObservableCollection <EntityPurchaseD>) this._entityListD; this.LayoutRoot.Children.Add(utlPurchase); break; case Common.geDataFormType.PaymentCashDetail: Utl_DataFormPaymentCash utlPaymentCash = new Utl_DataFormPaymentCash(); utlPaymentCash._entityH = (EntityPaymentCashH)this._entityH; utlPaymentCash._entityListD = (ObservableCollection <EntityPaymentCashD>) this._entityListD; this.LayoutRoot.Children.Add(utlPaymentCash); break; default: break; } //this.listDisplayTabIndex = ExVisualTreeHelper.GetDisplayTabIndex(this.GridMaster); // Tab Index 保持 }
protected override void OnKeyDown(KeyEventArgs e) { switch (e.Key) { case Key.Enter: #region DataForm ExDataForm _df = (ExDataForm)ExVisualTreeHelper.FindPerentDataForm(this); if (_df != null) { ExUserControl _utl = (ExUserControl)ExVisualTreeHelper.FindPerentUserControl(this); #region DataForm EstimateDetail Utl_DataFormEstimate utlEstimate = null; try { utlEstimate = (Utl_DataFormEstimate)_utl; } catch { } if (utlEstimate != null) { if (Keyboard.Modifiers == ModifierKeys.Shift) { utlEstimate.OnBeforeControl(); e.Handled = true; return; } else { utlEstimate.OnNextControl(); e.Handled = true; return; } } #endregion #region DataForm OrderDetail Utl_DataFormOrder utlOrder = null; try { utlOrder = (Utl_DataFormOrder)_utl; } catch { } if (utlOrder != null) { if (Keyboard.Modifiers == ModifierKeys.Shift) { utlOrder.OnBeforeControl(); e.Handled = true; return; } else { utlOrder.OnNextControl(); e.Handled = true; return; } } #endregion #region DataForm SalesDetail Utl_DataFormSales utlSales = null; try { utlSales = (Utl_DataFormSales)_utl; } catch { } if (utlSales != null) { if (Keyboard.Modifiers == ModifierKeys.Shift) { utlSales.OnBeforeControl(); e.Handled = true; return; } else { utlSales.OnNextControl(); e.Handled = true; return; } } #endregion } #endregion #region DataGrid ExDataGrid _dg = (ExDataGrid)ExVisualTreeHelper.FindPerentDataGrid(this); if (_dg != null) { if (Keyboard.Modifiers == ModifierKeys.Shift) { //_dg.MoveBeforeCell(); e.Handled = true; return; } else { //_dg.MoveNextCell(); e.Handled = true; return; } } #endregion #region Page ExPage _page = (ExPage)ExVisualTreeHelper.FindPerentPage(this); if (_page != null) { if (Keyboard.Modifiers == ModifierKeys.Shift) { _page.OnBeforeControl(); e.Handled = true; return; } else { _page.OnNextControl(); e.Handled = true; return; } } #endregion #region ChildWindow ExChildWindow _win = (ExChildWindow)ExVisualTreeHelper.FindPerentChildWindow(this); if (_win != null) { if (Keyboard.Modifiers == ModifierKeys.Shift) { _win.OnBeforeControl(); e.Handled = true; return; } else { _win.OnNextControl(); e.Handled = true; return; } } #endregion break; } base.OnKeyDown(e); }