public MainWindow() { InitializeComponent(); input = new MatrixInput(5) { HorizontalAlignment = HorizontalAlignment.Center }; this.Main.Children.Add(input); }
private void Button_Click(object sender, RoutedEventArgs e) { string dimText = DimInput.Text; if (!string.IsNullOrEmpty(dimText) && !string.IsNullOrWhiteSpace(dimText)) { int dim = int.Parse(DimInput.Text); Main.Children.Remove(input); input = new MatrixInput(dim) { HorizontalAlignment = HorizontalAlignment.Center }; Main.Children.Add(input); } }