/// <summary> /// /// </summary> /// <param name="cosplan"></param> /// <returns>False if Cosplan got deleted. Else True.</returns> public static bool Show(WPFBase parent, Core core, int cosplan) { Cosplan c = new Cosplan(parent) { core = core, cosplan = new Cosplans() { Where = "Nummer = " + cosplan } }; c.cosplan.Read(); c.ShowDialog(); return(!c.geloescht); }
private void Grid_MouseUp(object sender, MouseButtonEventArgs e) { Grid grid = (Grid)sender; if (this.selectedCosplan != null) { foreach (UIElement item in this.data.Children) { Grid child = (Grid)item; if (child.Background == Layout.SelectedBackground) { child.Background = Brushes.Transparent; break; } } } if (grid.Background == Layout.ButtonHover) { grid.Background = Layout.SelectedBackground; this.selectedCosplan = ((TextBlock)grid.Children[0]).Text.ToInt(); if (!Cosplan.Show(this, this.core, this.selectedCosplan.ToInt())) { this.ActualizeData(); } else { this.Grid_MouseUp(sender, e); } } else { grid.Background = Layout.ButtonHover; this.selectedCosplan = null; } }