title: Can't pass viewmodel in databinding to child include layout
body: <p>this is some code in my parent xml</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layout xmlns:app="http://schemas.android.com/apk/res-auto"
          xmlns:android="http://schemas.android.com/apk/res/android"
          xmlns:bind="http://schemas.android.com/apk/res-auto"&gt;
  &lt;data&gt;
      &lt;variable
              name="viewModel"
              type="(..).viewmodels.TestViewModel"/&gt;
  &lt;/data&gt;
  
  
  &lt;androidx.constraintlayout.widget.ConstraintLayout
          android:layout_height="match_parent"
          android:layout_width="match_parent"
          android:theme="@style/AppTheme.AppBarOverlay"
          &gt;
  
      &lt;ScrollView
              android:layout_width="match_parent"
              android:layout_height="match_parent"
              android:fillViewport="true"
              app:layout_constraintBottom_toBottomOf="parent"
              app:layout_constraintTop_toTopOf="parent"&gt;
  
          &lt;include
                  android:id="@+id/layout"
                  bind:viewModel="@{viewModel}"
                  layout="@layout/test_content"/&gt;
      &lt;/ScrollView&gt;
      &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <p>Here's the child include layout</p>
  
  <pre><code>&lt;layout
          xmlns:app="http://schemas.android.com/apk/res-auto"
          xmlns:tools="http://schemas.android.com/tools"&gt;
      &lt;data&gt;
          &lt;variable
                  name="viewModel"
                  type="(..).TestViewModel" /&gt;
      &lt;/data&gt;
  &lt;LinearLayout
          android:layout_height="match_parent"
          android:layout_width="match_parent"
          android:orientation="horizontal"
          tools:layout_editor_absoluteX="74dp"
          tools:layout_editor_absoluteY="1dp"
          xmlns:android="http://schemas.android.com/apk/res/android"&gt;
  
      &lt;androidx.constraintlayout.widget.ConstraintLayout
              android:layout_width="match_parent"
              android:layout_height="match_parent"&gt;
  
          &lt;Button
                  android:id="@+id/disable"
                  android:layout_width="match_parent"
                  android:layout_height="100dp"
                  android:background="@color/orange"
                  android:text="@{viewModel.buttonText}"
                  app:layout_constraintEnd_toEndOf="parent"
                  app:layout_constraintHorizontal_bias="0.5"
                  app:layout_constraintStart_toStartOf="parent"
                  app:layout_constraintTop_toTopOf="parent" /&gt;
  
      &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  
  &lt;/LinearLayout&gt;
  &lt;/layout&gt;
  </code></pre>
  
  <p>As you can see in this example I data binded text to the viewmodel and passed it down from parent to child via bind:viewModel="@{viewModel}"</p>
  
  <p>Here's the code in the activity:</p>
  
  <pre><code>val binding:TestContentBinding = DataBindingUtil.setContentView(this, R.layout.test_content)
  binding.setLifecycleOwner(this)
  binding.viewModel = testViewModel
  </code></pre>
  
  <p>If I set the binding to the child xml then the data gets binded, however if i set the binding to the parent activity the viewmodel doesn't get passed down.</p>
  
  <p>The back end certainly has the correct data however I don't know how to bind data to the child.
  I've even tried manually setting the layout's viewModel however that doesn't work. How do I pass the viewmodel?</p>