How to pass the data to the name space xml file


#1

How to pass the data to the name space xml file. I tried like this

<drugLayouts:common-render attributes="adultDosing"/>

And i want to use that variable directly in the xml file

<StackLayout xmlns:drugLayouts="~/views/drug/drug-layouts">
    <StackLayout class="dosing-item {{children ? 'dosing-item': 'no-dosing-item'}}" visibility = "{{ value ? 'visible':'collapse' }}">
        <Label class="dosage-item-text font-22 notoSans-bold" text="{{ label }}"/>
        <Repeater items="{{ value }}">
            <Repeater.itemTemplate>
                <Label textWrap="true" class="dosage-item-text font-22" text="{{ $value }}" />
            </Repeater.itemTemplate>
        </Repeater>
    </StackLayout>
    <StackLayout class="drug-details-wrapper" visibility="{{ children ? 'visible':'collapse' }}">
        <Repeater items="{{children}}">
            <Repeater.itemTemplate>
                <drugLayouts:common-render/>
            </Repeater.itemTemplate>
        </Repeater>
    </StackLayout>
</StackLayout>

#2

When you declare the component inside Repeater it should inherit the bindingContext of the current repeater item, so you might directly able to access the data element.