I have 2 buttons and they do the same on different controls. How can i make this better? Because now i too much copy/paste. Here is image and code.

[enter image description here](http://i.stack.imgur.com/YjiW1.png)

```
    private void button_ClickOld(object sender, RoutedEventArgs e)
    {
        TextBoxOld.Text = SelectCatalog();
        if (File.Exists(TextBoxOld + ConfigFilePath))
        {
            GetClientProperty(TextBoxOld.Text);
            UpdateOldLabel();
        }
        else
        {
            LogsTextBox.AppendText("\nWrong folder selected - Config file doesn't exist");
        }
    }
    private void button_ClickNew(object sender, RoutedEventArgs e)
    {
        TextBoxNew.Text = SelectCatalog();
        if (File.Exists(TextBoxNew + ConfigFilePath))
        {
            GetClientProperty(TextBoxNew.Text);
            UpdateNewLabel();
        }
        else
        {
            LogsTextBox.AppendText("\nWrong folder selected - Config file doesn't exist");
        }
    }

```

xaml

```
 <Button x:Name="ButtonOld" Content="..." HorizontalAlignment="Left" Margin="149,35,0,0" VerticalAlignment="Top" Width="25" Click="button_ClickOld"/>
    <TextBox x:Name="TextBoxOld" HorizontalAlignment="Left" Height="23" Margin="24,35,0,0" Text="" VerticalAlignment="Top" Width="120" IsReadOnly="True"/>
    <Button x:Name="ButtonNew" Content="..." HorizontalAlignment="Left" Margin="447,35,0,0" VerticalAlignment="Top" Width="25" Click="button_ClickNew"/>
    <TextBox x:Name="TextBoxNew" HorizontalAlignment="Left" Height="23" Margin="322,35,0,0" Text="" VerticalAlignment="Top" Width="120" IsReadOnly="True"/>` <Label x:Name="OldNameLabel" Content="Name" HorizontalAlignment="Left" Margin="24,70,0,0" VerticalAlignment="Top"/>
    <Label x:Name="OldIpLabel" Content="IP" HorizontalAlignment="Left" Margin="24,100,0,0" VerticalAlignment="Top"/>
    <Label x:Name="OldWebpageUriLabel" Content="WebpageUri" HorizontalAlignment="Left" Margin="24,130,0,0" VerticalAlignment="Top"/>
    <TextBox x:Name="OldConnectionStringTextBox" Text="ConnectionString" HorizontalAlignment="Left" Margin="24,160,0,0" Width="120"
             VerticalAlignment="Top" Background="Linen" BorderThickness="0" IsReadOnly="True"/>
    <Label x:Name="NewNameLabel" Content="Name" HorizontalAlignment="Left" Margin="322,70,0,0" VerticalAlignment="Top"/>
    <Label x:Name="NewIpLabel" Content="IP" HorizontalAlignment="Left" Margin="322,100,0,0" VerticalAlignment="Top"/>
    <Label x:Name="NewWebpageUriLabel" Content="WebpageUri" HorizontalAlignment="Left" Margin="322,130,0,0" VerticalAlignment="Top"/>
    <TextBox x:Name="NewConnectionStringTextBox" Text="ConnectionString" HorizontalAlignment="Left" Margin="322,160,0,0" Width="120"
             VerticalAlignment="Top" Background="Linen" BorderThickness="0" IsReadOnly="True"/>
    <Label x:Name="ArrowLabel" Content="&lt;-" HorizontalAlignment="Left" Margin="221,14,0,0" VerticalAlignment="Top" FontSize="30" />
    <Label x:Name="OldVersionTextBoxLabel" Content="Old Version:" HorizontalAlignment="Left" Margin="24,4,0,0" VerticalAlignment="Top"/>
    <Label x:Name="NewVersionTextBoxLabel" Content="New Version:" HorizontalAlignment="Left" Margin="325,4,0,0" VerticalAlignment="Top"/>`

```