public void ColorItem() { grid.Background = new SolidColorBrush(Colors.Orange); tbItemName.Foreground = new SolidColorBrush(Colors.White); tbCombinado.Foreground = new SolidColorBrush(Colors.White); tbExecutingTime.Foreground = new SolidColorBrush(Colors.White); tbPrepareTime.Foreground = new SolidColorBrush(Colors.White); stpAdicional.Children.Clear(); if (this.itemData.Aditionals != null && this.itemData.Aditionals.Count > 0) { for (int i = 0; i < this.itemData.Aditionals.Count; i++) { AccountItemAditional adicionalData = this.itemData.Aditionals[i]; TextBlock tbAdicional = new TextBlock { Width = 284, Text = "- " + adicionalData.Name, FontSize = 18, Foreground = new SolidColorBrush(Colors.White), Padding = new Thickness(0) }; this.stpAdicional.Children.Add(tbAdicional); } } }
public void DefaultColorItem(int timerInicial) { if (timerInicial <= (timerMinimo * 0.75)) { grid.Background = new SolidColorBrush(Colors.LightGreen); } else if (timerInicial >= timerMinimo) { grid.Background = new SolidColorBrush(Colors.LightCoral); } else { grid.Background = new SolidColorBrush(Colors.LightYellow); } tbItemName.Foreground = new SolidColorBrush(Colors.Black); tbCombinado.Foreground = new SolidColorBrush(Colors.Black); tbExecutingTime.Foreground = new SolidColorBrush(Colors.Black); tbPrepareTime.Foreground = new SolidColorBrush(Colors.Black); stpAdicional.Children.Clear(); if (this.itemData.Aditionals != null && this.itemData.Aditionals.Count > 0) { for (int i = 0; i < this.itemData.Aditionals.Count; i++) { AccountItemAditional adicionalData = this.itemData.Aditionals[i]; TextBlock tbAdicional = new TextBlock { Width = 284, Text = "- " + adicionalData.Name, FontSize = 18, Foreground = new SolidColorBrush(Colors.Black), Padding = new Thickness(0) }; this.stpAdicional.Children.Add(tbAdicional); } } }
public void initialize() { this.tbItemName.Text = this.itemData.Quantity + " " + this.itemData.Name; this.PrepareTime = this.itemData.PrepareTime * this.itemData.Quantity; InitialStatusCode(); obtertimerMaximo(); obtertimerMinimo(); if (this.itemData.Aditionals != null && this.itemData.Aditionals.Count > 0) { for (int i = 0; i < this.itemData.Aditionals.Count; i++) { AccountItemAditional adicionalData = this.itemData.Aditionals[i]; TextBlock tbAdicional = new TextBlock { Width = 284, Text = "- " + adicionalData.Name, FontSize = 18, Padding = new Thickness(0) }; this.stpAdicional.Children.Add(tbAdicional); } } if (this.itemData.ComboName != null && this.itemData.ComboName.Length > 0) { this.tbCombinado.Text = "(#" + this.itemData.ComboName + ")"; this.combinado++; this.tbCombinado.Visibility = Visibility.Visible; } else { stpAdicional.Margin = new Thickness(25, 29, 304, 3); } if (itemData.Aditionals != null) { qtdAdicional = itemData.Aditionals.Count; } if (qtdAdicional <= 0) { stpAdicional.Visibility = Visibility.Collapsed; } if (qtdAdicional == 1) { widthAdicional = qtdAdicional * 27; } else { widthAdicional = qtdAdicional * 24; } ChangeViewMode(); if (PrepareTime >= 60) { minLimit = (PrepareTime / 60); segLimit = (PrepareTime % 60); } else { minLimit = 0; segLimit = PrepareTime; } tbPrepareTime.Text = minLimit.ToString().PadLeft(2, '0') + ":" + segLimit.ToString().PadLeft(2, '0'); timerScreen(); }