Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Binding Item itself inside list dataTemplate xaml

Tags:

c#

xaml

xamarin

I can't find the right syntax to bind directly the item of my list in xaml.

<Listview ItemsSource={Binding Items}>
    <Listview.ItemTemplate>
        <CustomUserControl Item={Binding} />
    </Listview.ItemTempalte>
</Listview>

this code works fine. But when i want to add a converter to the binding, it displays me a syntax error :

<Listview ItemsSource={Binding Items}>
    <Listview.ItemTemplate>
        <CustomUserControl Item={Binding ,Converter={StaticResource myConverter}} />
    </Listview.ItemTempalte>
</Listview>

Does anyone know the way to do it ?

Thanks!

like image 556
Alexandre Dairay Avatar asked Oct 25 '25 15:10

Alexandre Dairay


1 Answers

Ok so the answer was just

{Binding Converter={StaticResource myConverter}}

without the comma..

like image 102
Alexandre Dairay Avatar answered Oct 28 '25 06:10

Alexandre Dairay



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!