Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
75
XamDoughnutChart becomes null after exiting last tab.
posted

Hi,

This is a weird one...

I am using Xamarin Forms and testing on Android only.

I have a TabbedPage with 5 tabs at the bottom, that is hosted inside a NavigationPage.

I have XamDoughnutChart with data that works fine in the first tab. Here is the code:

        <!--DoughnutChart-->
        <ig:XamDoughnutChart SliceClick="DoughnutSliceClicked"
                             AllowSliceExplosion="True"
                             x:Name="doughnutChart"
                             Grid.Row="0"
                             Grid.RowSpan="5"
                             Grid.Column="0"
                             Grid.ColumnSpan="3"
                             AllowSliceSelection="True" >

            <ig:XamDoughnutChart.Series>
                <ig:RingSeries ItemsSource="{Binding Balances, Mode=OneTime}"
                               LabelMemberPath="CurrencyCode"
                               ValueMemberPath="Balance1"
                               LabelsPosition="BestFit"/>
            </ig:XamDoughnutChart.Series>
        </ig:XamDoughnutChart>

Now the when I move to tab 2 3.. and back, no problems. However, when I move to very last tab (5) and back to any other tab, it reaches this (==>) breakpoint only:

        List<Balance> balances;
        public List<Balance> Balances
        {
            get
==>     {
                return balances;
            }
            set
            {
                if (balances != value)
                {
                    balances = value;
                    OnPropertyChanged("Balances");
                }
            }
        }

Now there is only 1 reference to this "Balances" which is when I initially fill it, and there is only 1 binding which I wrote above.

also, the lowercase "balance" still contains the same valid 7 rows of data. So even following this "get" through it should just update.

The last tab is blank as per the code below.

XAML Code in last (5th) tab:

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns="">xamarin.com/.../forms"
             xmlns:x="">schemas.microsoft.com/.../xaml"
             xmlns:d="">xamarin.com/.../design"
             xmlns:mc="">schemas.openxmlformats.org/.../2006"
             x:Class="Impress.App.Views.More"
          
             Title="More">

</ContentPage>

C# Code

    [XamlCompilation(XamlCompilationOptions.Compile)]
    public partial class More : ContentPage
    {
        public More()
        {
            InitializeComponent();
        }
    }

So the chart becomes blank, and if I tap it, I get a null exception.

As I am writing, I commented out the DoughnutChart code in XAML, and it's not reaching that "get" code anymore, so it's 100% the chart thats calls in after leaving 5th tab.. I suspect there is a bug in the control, as datagrid control on the same page, even with same data is fine.

Parents
No Data
Reply
  • 34430
    Offline posted

    Hello Edgaras,

    I have been investigating into this behavior you are seeing, and I have reproduced it on my end. It is very strange that this only seems to happen when you have many tabs and then you navigate back from the last one back to the XamDoughnutChart page. I have also reproduced the Null Reference Exception when tapping on where the chart should be.

    This behavior is unexpected, and as such, I have asked our development teams to examine it further. In order to ensure this receives attention, I have logged it in our internal tracking systems with a development ID of 264655. I will be linking this to a private support case that I have created as well, so that you can be notified when a fix becomes available. This case has an ID of CAS-202725-X1Y9M4 and you can access it here: https://www.infragistics.com/my-account/support-activity.

    Please let me know if you have any other questions or concerns on this matter.

Children
No Data