private void ButtonClick(object sender, RoutedEventArgs e) { if (B != null && cb.SelectedItem != null) { B.Background = new SolidColorBrush(xColor.SelectedColor); B.Content = (xCaption.Text); B.Tag = ((TypePay)cb.SelectedItem).Id; ClassGridGroup.Save(B); Close(); } }
private void ButtonClick(object sender, RoutedEventArgs e) { if (B != null) { B.Background = new SolidColorBrush(xColor.SelectedColor); ((Label)((StackPanel)B.Content).FindName(Sub + "lb_" + xName.Content + "x" + yName.Content)).Content = (xCaption.Text); B.Tag = ((DAL.Models.Currency)cb.SelectedItem).CustomerId; ClassGridGroup.Save(B); Close(); } }
private void ButtonClick(object sender, RoutedEventArgs e) { var main = Owner as MainWindow; var name = Sub + "_" + xName.Content + "x" + yName.Content; var button = (Button)main.FindName(name); if (button != null) { button.Background = new SolidColorBrush(xColor.SelectedColor); button.Foreground = new SolidColorBrush(xColorFont.SelectedColor); button.Content = xCaption.Text; var elm = button.Tag as ClassGridGroup.Elm ?? new ClassGridGroup.Elm( RepositoryXmlFile.GetPathByType(XmlDocEnum.B), (byte)X, (byte)Y, button.Content.ToString(), GetSelected(xGBFunction)); elm.Func = GetSelected(xGBFunction); elm.Background = button.Background; elm.Foreground = button.Foreground; elm.Caption = button.Content.ToString(); if (elm.Caption == string.Empty) { ProductType product; elm.Caption = FunctionsTranslateService.GetTranslatedFunctionWithProd(elm.Func, out product); button.Content = elm.Caption; } button.Tag = elm; var bReset = (Button)sender; if (bReset.Tag.ToString() == "Réinitialiser la configuration") { button.Tag = "None - Vide"; } if (button.Tag != null && button.Tag.ToString() == "None - Vide") { button.ClearValue(BackgroundProperty); button.Content = string.Empty; button.ToolTip = Properties.Resources.LabelNone; } ClassGridGroup.Save(button); Close(); } }