Quantcast
Channel: Xamarin.Forms — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 77050

Code behind multi context Binding

$
0
0

Hi !

I need an equivalent in the code file:

<templates:JobObjectTemplate BindingContext="{Binding JobObject}"
                    ItemHeight="{Binding Source={x:Reference This}, Path=ItemHeight}"/>

This my method, but it does not work:

private JobObjectTemplate CreateJobView(JobObject jo)
        {
            var template = new JobObjectTemplate
            {
                BindingContext = jo,
            };
            template.SetBinding(ItemHeightProperty, "ItemHeight");
            template.ItemHeight = ItemHeight;
            return template;
        }

I want to bind two bindableProperty through the code using multiple BindingContext.


Viewing all articles
Browse latest Browse all 77050

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>