We would like to bring to your notice a bug that we encountered recently, while binding a collection to CustomView Bindable property in XAML page, gives null value in OnBindablePropertyChangedMethod(). We have reproduced this issue by writing CustomView derived from Grid Layout, and binding a collection to this CustomView Bindable property in XAML page.
Following points happened while hit the break points in OnBindablePropertyChangedMethod().
While first time flow at newValue we get count 0 from constructor of CustomView.
At second time we are getting null value from InitializeComponent().
At third time we able to get the binding collection item count.
Getting null value at second time flow, was making issue in our Control, So Check and provide a solution at second time hit itself, Is it possible to get bindable collection count in newValue param. Issue was with all Xamarin Forms all platforms. Also I would like to mention binding a collection in code behind file, OnBindablePropertyChanged() newValue param does not have any null value at any time hits. Issue was only while using XAML Page.
Steps to Reproduce
Run the attached sample
Hits the break point in OnBindablePropertyChanged().
Please note a newValue param in this method at second time hit, The value was null.
Note : Already we have reported above mentioned issue in git-hub, But unfortunately due to sample issue, report was closed by Xamarin team, This time we have attached the correct reproduction sample.
Expected Behavior
The newValue param should not be null at second time hit in OnBindablePropertyChanged(), we want bindable collection item count instead of null value.
Actual Behavior
The newValue param has null value at second time hit in OnBindablePropertyChanged().
The behavior appears to occur as described (value of 0 and then null before another non-null value) using the reproduction, as well as against the 3.4-pre.
Description
We would like to bring to your notice a bug that we encountered recently, while binding a collection to CustomView Bindable property in XAML page, gives null value in OnBindablePropertyChangedMethod(). We have reproduced this issue by writing CustomView derived from Grid Layout, and binding a collection to this CustomView Bindable property in XAML page. Following points happened while hit the break points in OnBindablePropertyChangedMethod().
Getting null value at second time flow, was making issue in our Control, So Check and provide a solution at second time hit itself, Is it possible to get bindable collection count in newValue param. Issue was with all Xamarin Forms all platforms. Also I would like to mention binding a collection in code behind file, OnBindablePropertyChanged() newValue param does not have any null value at any time hits. Issue was only while using XAML Page.
Steps to Reproduce
Note : Already we have reported above mentioned issue in git-hub, But unfortunately due to sample issue, report was closed by Xamarin team, This time we have attached the correct reproduction sample.
Expected Behavior
The newValue param should not be null at second time hit in OnBindablePropertyChanged(), we want bindable collection item count instead of null value.
Actual Behavior
The newValue param has null value at second time hit in OnBindablePropertyChanged().
Basic Information
Reproduction Sample Link
GridNotLoade_GitHub.zip