ตัวอย่างที่สมบูรณ์อย่างง่าย
  เพียงแค่ตั้งค่ารูปแบบรวมและการใช้งานidbinding.includedLayout.anyView
ตัวอย่างนี้ช่วยส่งค่าไปยัง<include& เข้าถึงมุมมองที่รวมอยู่ในโค้ด
ขั้นตอนที่ 1
คุณมีlayout_common.xmlต้องการส่งStringต่อไปยังเค้าโครงที่รวมไว้
คุณจะสร้างStringตัวแปรในรูปแบบและการอ้างนี้ไปStringTextView
<data>
    // declare fields
    <variable
        name="passedText"
        type="String"/>
</data>
<TextView
    android:id="@+id/textView"
    ...
    android:text="@{passedText}"/> //set field to your view.
ขั้นตอนที่ 2
รวมเค้าโครงนี้กับเค้าโครงหลัก ให้idเค้าโครงที่รวมไว้เพื่อให้เราสามารถใช้ในคลาสที่มีผลผูกพัน ตอนนี้คุณสามารถส่ง String passedTextไปยัง<includeแท็กของคุณ
activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<layout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:app="http://schemas.android.com/apk/res-auto">
    <LinearLayout
        ..
        >
        <include
            android:id="@+id/includedLayout"
            layout="@layout/layout_common"
            app:passedText="@{@string/app_name}" // here we pass any String 
            />
    </LinearLayout>
</layout>
- คุณสามารถใช้ตอนนี้
binding.includedLayout.textViewในชั้นเรียนของคุณได้ 
คุณสามารถส่งตัวแปรใด ๆ ไปยังเค้าโครงที่รวมไว้เช่นด้านบน
ActivityMainBinding binding = DataBindingUtil.setContentView(this, R.layout.activity_main);
binding.includedLayout.textView.setText("text");
 
หมายเหตุทั้งสองเค้าโครง (พาเรนต์และรวม) ควรถูกbinding layoutรวมไว้ด้วย<layout
               
              
<include layout="@layout/buttons" android:id="@+id/buttons"/>. คุณยังคงต้องใช้รหัสเพื่อที่จะสร้างฟิลด์สาธารณะสำหรับคุณเพื่อให้คุณสามารถเข้าถึงมุมมองปุ่มได้