private void OnLayoutSelected(object sender, EventArgs e) { Button bnSender = sender as Button; foreach (var ctrl in Controls) { if (ctrl is Button bt && bt != bnSender) { if (bt.Tag is HCylLayoutItem btItem && btItem.Selected) { btItem.Selected = false; bt.Image = TryGeneratePatternImage(btItem.Layout, szButtons, btItem.Selected); } } } // *** HCylLayoutItem lItem = bnSender.Tag as HCylLayoutItem; bool selected = true; bnSender.Image = TryGeneratePatternImage(lItem.Layout, szButtons, selected); bnSender.Tag = new HCylLayoutItem(lItem.Layout, selected); LayoutSelected?.Invoke(this, e); }
private void InitializeLayoutButton() { Button.Click += (o, args) => LayoutSelected?.Invoke(this, EventArgs.Empty); CultureCodeTextBlock.Text = layout.CultureCode; LayoutNameTextBlock.Text = layout.Name; }
private void InitializeEvents() { Button.Click += (o, args) => LayoutSelected?.Invoke(layout.Id); }
private void Button_LayoutSelected(Guid id) { Popup.IsOpen = false; LayoutSelected?.Invoke(id); }