private void OnGridSizeChangeButtonClicked(object sender, System.Windows.RoutedEventArgs e) { try { int width = Convert.ToInt32(Width.Text); int height = Convert.ToInt32(Height.Text); bool successful = csu.ResizeFactory(width, height); if (!successful) { ShowPopUp("Grid kann nicht verkleinert werden. Maschinen würden außerhalb des gültigen Bereichs liegen. "); Width.Text = "" + csu.GetAreaWidth(); Height.Text = "" + csu.GetAreaHeight(); } } catch (FormatException) { ShowPopUp("Falsche Eingabe"); } }