private void UpdateNavigationButtonDisplay(double offset = 0) { var backwardEnabled = offset > 0; var forwardEnabled = offset + (this.ActualWidth + 10) < _cordX + _orderWidth; BackwardNavigationButton.IsEnabled = backwardEnabled; LeftNavigationButton.IsEnabled = backwardEnabled; ForwardNavigationButton.IsEnabled = forwardEnabled; RightNavigationButton.IsEnabled = forwardEnabled; OrderContainer.Focus(); }
private void MainWindow_Activated(object sender, EventArgs e) { if (OrderContainer.ActualWidth > 0) { OrderWidth = this.ActualWidth / ChefmateController.Instance.PageColumns; HorizontalScale = this.ActualWidth / (ChefmateController.Instance.PageColumns * OrderWidth); } _maxHeight = OrderContainer.ActualHeight; ParentScroller.Width = this.ActualWidth; OrderContainer.MinWidth = this.ActualWidth; OrderContainer.Focus(); }
private void MainWindow_PreviewKeyUp(object sender, KeyEventArgs e) { this.Focus(); if (ChefmateController.Instance.CurrentSettings.KeypadOperation == KeypadOperation.BumpByLocation) { BumpByLoacation(e.Key); } else { BumpByChitTableNumber(e.Key); } OrderContainer.Focus(); }
private void Recall(object sender, RoutedEventArgs e) { RecallOrderView recallOrderView = new RecallOrderView { ShowInTaskbar = false }; recallOrderView.ShowDialog(); if (recallOrderView.ModalResult && recallOrderView.SelectedOrder != null) { ChefmateController.Instance.AddRecallOrder(recallOrderView.SelectedOrder); } OrderContainer.Focus(); }
private void Setting(object sender, RoutedEventArgs e) { var displayType = ChefmateController.Instance.CurrentSettings.GroupType; var settingView = new SettingView { ShowInTaskbar = false, Topmost = true }; settingView.ShowDialog(); IsRecallEnabled = ChefmateController.Instance.CurrentSettings.TerminalType == TerminalType.Kitchen; Properties.Settings.Default.DatabasePath = ChefmateController.Instance.CurrentSettings.DbPath; Properties.Settings.Default.DatabaseAddress = ChefmateController.Instance.CurrentSettings.DbIpAddress; Properties.Settings.Default.Save(); ChefmateController.Instance.SaveSettings(); SetFont(); if (displayType != ChefmateController.Instance.CurrentSettings.GroupType) { RedrawOrders(); } OrderContainer.Focus(); }