Multiple Drawers?

3 posts, 0 answers
  1. Kevin
    Kevin avatar
    7 posts
    Member since:
    Oct 2015

    Posted 22 Oct 2015 Link to this post

    Trying to get a little tricky here, to see what I can and can't do.  I have the following in my App.cs in my Xamarin.Forms project:


                BindingContext = new MainViewModel();

                RadSideDrawer rsd = new RadSideDrawer();
                rsd.DrawerLength = 250;

                RadPieChart pie = new RadPieChart();

                PieSeries series = new PieSeries();
                series.SetBinding( BarSeries.ItemsSourceProperty, new Binding( "Data" ) );
                series.ValueBinding = new PropertyNameDataPointBinding() { PropertyName = "Value" };

                pie.Series.Add( series );

                RadSideDrawer rightDrawer = new RadSideDrawer();

                StackLayout slr = new StackLayout();
                slr.Padding = 20;
                slr.Children.Add( new Label() { Text = "Right Side" } );
                slr.Children.Add( new Button() { Text = "​R One" } );
                slr.Children.Add( new Button() { Text = "​R Two" } );
                slr.Children.Add( new Button() { Text = "​R Three" } );
                slr.Children.Add( new Button() { Text = "​R Four" } );
                rightDrawer.DrawerContent = slr;
                rightDrawer.DrawerLocation = Telerik.XamarinForms.Primitives.SideDrawer.SideDrawerLocation.Right;
                rightDrawer.MainContent = pie;

                rsd.MainContent = rightDrawer;

                StackLayout sl = new StackLayout();
                sl.Padding = 20;
                sl.Children.Add( new Label() { Text = "Left Side" } );
                sl.Children.Add( new Button() { Text = "​L One" } );
                sl.Children.Add( new Button() { Text = "​L Two" } );
                sl.Children.Add( new Button() { Text = "​L Three" } );
                sl.Children.Add( new Button() { Text = "L Four" } );

                rsd.DrawerContent = sl;

                // The root page of your application
                ContentPage p = new ContentPage();
                p.BackgroundColor = Xamarin.Forms.Device.OnPlatform( Xamarin.Forms.Color.White, Xamarin.Forms.Color.White, Xamarin.Forms.Color.Transparent );

                p.Content = rsd;

                MainPage = p;

    Ignoring the ViewModel and PieChart data, the Pie Chart here doesn't render.  If I remove one of the Drawers, and set the remaining drawer's MainContent to the pie chart, it works. But the embedded drawers here prevent the chart from rendering.

     Is there a way to make this work?


  2. Pavel R. Pavlov
    Pavel R. Pavlov avatar
    1251 posts

    Posted 27 Oct 2015 Link to this post

    Hi Kevin,

    Thank you for contacting us. The provided code was really helpful in reproducing your scenario on our side. We confirm that the reported issue exist in our latest official release. This is why I logged it in our system and I will make sure it reaches the respective developer. Also, I updated your Telerik points.

    As for the issue itself, it seems that the BindingContext of the MainContent of the inner RadSideDrawer does not propagate (to the outer one) as expected. This is why you can try setting the BindingContext property to the RadPieChart directly. 

    I hope you will be able to use this workaround in your real live app. Please do not hesitate to contact us again if you encounter any other issues.

    Pavel R. Pavlov
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
  3. Kevin
    Kevin avatar
    7 posts
    Member since:
    Oct 2015

    Posted 27 Oct 2015 in reply to Pavel R. Pavlov Link to this post

    That did the trick!  Thanks, Pavel!



Back to Top