Question: I'd like to make 3 rows in a grid in a WPF datatemplate. The first is set to Height=Auto, the second fills the available space and the third is equal to the first. I've tried with binding to elementname, but that doesn't seem to work

```
<Grid>
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" x:Name="definition" />
        <RowDefinition Height="*" />
        <RowDefinition Height="{Binding ElementName=definition, Path=ActualHeight}" />
    </Grid.RowDefinitions>

    <TextBox Grid.Row="0" Height="100" />
</Grid>

```

In this example I hope the height of the third row is also 100px. Any suggestions?

Answer: 
My suggestion is:Set the `onClick` in the `XML` file, and create the method in the current class.

```
<Button
    android:id="@+id/btn_1"
    android:layout_width="wrap_content"
    android:layout_height="wrap_content"
    android:onClick="click" />

public void click(View arg0) {
}

```
Agree with Graph that you should have to @Override the onClick method. Not sure what's wrong with it there. In fact, when I typed your example into Android Studio, I got 3 letters into OnClickListener and it automatically filled in the rest, including the @Override.

```
 button.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View v) {
            String text = v.toString();
            // do something with the text.
        }
    });

```

Also, I don't think v.toString() is going to get you any useful information. If you want the text off the button, you're going to want to cast it to a button then call getText():

```
Button button = (Button) v;
String text = button.getText().toString();

```

or, you could do:

```
String text = ((Button)v).getText().toString();

```

Simply calling v.toString() is going to get you a description of that button, not the text on it.