title: How to pass data variable to included layout?
body: <p>Is there a way to pass data variable to included layout?</p>
  
  <p>parent layout</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8"?&gt;
  &lt;layout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      tools:showIn="@layout/fragment_settings"&gt;
  
      &lt;data&gt;
  
          &lt;variable
              name="viewModel"
              type="......settings.SettingsFragmentViewModel" /&gt;
      &lt;/data&gt;
  
      &lt;androidx.constraintlayout.widget.ConstraintLayout
          android:id="@+id/content"
          android:layout_width="match_parent"
          android:layout_height="wrap_content"
          android:animateLayoutChanges="true"
          android:overScrollMode="never"
          android:padding="@dimen/spacing_default"&gt;
  
          &lt;include
              android:id="@+id/main"
              layout="@layout/layout_settings_main" /&gt;
  
      &lt;/androidx.constraintlayout.widget.ConstraintLayout&gt;
  </code></pre>
  
  <p>and want to have viewModel in included layout</p>
  
  <pre><code>&lt;layout xmlns:android="http://schemas.android.com/apk/res/android"
      xmlns:app="http://schemas.android.com/apk/res-auto"
      xmlns:tools="http://schemas.android.com/tools"
      tools:showIn="@layout/fragment_settings"&gt;
  
      &lt;data&gt;
  
          &lt;variable
              name="viewModel"
              type="......settings.SettingsFragmentViewModel" /&gt;
      &lt;/data&gt;
  
      &lt;merge&gt;
  ...........
  </code></pre>
  
  <p>or is it possible only when setting like this:</p>
  
  <pre><code> binding = FragmentSettingsBinding.inflate(inflater, container, false).apply {
              lifecycleOwner = this@SettingsFragment
              viewModel = this@SettingsFragment.viewModel
              main.viewModel = this@SettingsFragment.viewModel
          }
  </code></pre>