public MainWindow()
        {
            InitializeComponent();
            TextBlock block = new TextBlock();

            block.Text = "Lorem";
            StackPanel panel = new StackPanel();

            panel.Children.Add(block);

            Button b = new Button();

            b.Content    = "Szia";
            b.Background = Brushes.LightSkyBlue;
            Button b2 = new Button();

            b2.Content = "Dolgozo Hozzáadása";
            b2.Name    = "btn2";
            b2.Click  += formMegnyitasa;

            Grid grid = new Grid();

            grid.Width         = 500;
            grid.Background    = Brushes.Beige;
            grid.Margin        = Thickness.Parse("20,10,20,10");
            grid.ShowGridLines = true;
            ColumnDefinition column1 = new ColumnDefinition(GridLength.Parse("2*"));
            ColumnDefinition column2 = new ColumnDefinition(GridLength.Parse("*"));

            grid.ColumnDefinitions.Add(column1);
            grid.ColumnDefinitions.Add(column2);
            RowDefinition row = new RowDefinition();

            grid.RowDefinitions.Add(row);
            Grid.SetColumn(b, 0);
            Grid.SetColumn(b2, 1);
            grid.Children.Add(b);
            grid.Children.Add(b2);

            panel.Children.Add(grid);
            WrapPanel root = this.Find <WrapPanel>("wrappanel");

            root.Orientation = Orientation.Vertical;
            root.Children.Add(panel);
            NameScope scope = new NameScope();

            b2.RegisterInNameScope(scope);
            root.RegisterInNameScope(scope);
            Button sayhibutton = this.Find <Button>("sayhibutton");

            sayhibutton.RegisterInNameScope(scope);
            sayhibutton.Click += sayhi;
            NameScope.SetNameScope(this, scope);
        }