This is a migrated thread and some comments may be shown as answers.

SideDrawer stays empty

8 Answers 92 Views
SideDrawer
This is a migrated thread and some comments may be shown as answers.
Julian
Top achievements
Rank 1
Julian asked on 08 Jul 2016, 03:23 PM

Hello guys,

I am facing a confusing error with the SideDrawer control in my Xamarin Forms application. I am using the current nuget version of the control.
In my application I am setting the Content of the sidedrawer in C# like this:

Class 1:

     InitializeComponent();
     Drawer.DrawerContent = App.ConnectService.SideDrawer ;


This works great, but I am running into a problem when I navigate to another Page.
The problem appears when I popback to Class 1 without opening the SideDrawer on the Pushed Page. In this case the Sidedrawer stays white.
In the debugger, I can see that the drawer content is still set. So setting Drawer.DrawerContent = App.ConnectService.SideDrawer; again doesn’t change anything

When I open the SideDrawer on the pushed Page once, I don’t run into this strange effect.

Best regards

Julian

8 Answers, 1 is accepted

Sort by
0
Julian
Top achievements
Rank 1
answered on 11 Jul 2016, 08:47 AM

Just a short update.

If I call:

    Drawer.DrawerContent = null;

    Drawer.DrawerContent = App.ConnectService.SideDrawer ;

the view is visible again.

Best regards

Julian

0
Ves
Telerik team
answered on 13 Jul 2016, 01:23 PM
Hi Julian,

I have attached a small example, which seems to work fine for me. Can you please modify it, so that it matches your scenario and the issue is reproduced. This way we will be able to review it locally and get back to you with our findings.

Best regards,
Ves
Telerik by Progress
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
0
Julian
Top achievements
Rank 1
answered on 23 Sep 2016, 02:33 PM
Hey guys, I've created a little Xamarin-forms example project to present the problem to you.

How to reproduce the problem: 
1: Open the Sidedrawer on the left side.
2: Navigate to another page over the Sidedrawer.

On Android everything is working fine until now, but on iOS the Sidedrawer stays empty. Even if you navigate back to Page1 this Drawer is empty too.

Since my navigationmenu is huge in my app I don't want to create multiple instances. I would like to share a single instance through the entire app. 

Best regards
Julian
0
Ves
Telerik team
answered on 28 Sep 2016, 02:20 PM
Hi Julian,

Thanks for the project. I have edited your message to remove the link, as it contains Telerik assemblies. As for the problem -- I can confirm that I can see improper behavior. It will take a while to debug it. I will write back as soon as I have more information.

Best regards,
Ves
Telerik by Progress
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
0
Julian
Top achievements
Rank 1
answered on 28 Sep 2016, 02:24 PM

Hi Ves,

I am sorry for posting a Link containing your assemblies. 
Thanks in advance for your help.

 

Best regards ,

Julian

0
Ves
Telerik team
answered on 29 Sep 2016, 06:46 AM
Hi Julian,

Here are some more details. Swiping from left after navigation does not really open the new page's SideDrawer. This gesture actually navigates back to Page1. Now, for some reason Page1 is not restored correctly, so the SideDrawer appears empty. This is easily worked around -- move the code that sets DrawerContent in OnAppearing method, but first set it to null:

protected override void OnAppearing()
        {
            base.OnAppearing();
            Drawer.DrawerContent = null;
            Drawer.DrawerContent = App.ConnectService.Menu;
        }

With this change the app would work like this: on swipe from left, the app navigates back to Page1 with the SideDrawer already open and populated. Using navigation with SideDrawer in each page is not supported in Xamarin.Forms. The problem is in the NavigationController, which gets the gesture, hence SideDrawer of Page2 and Page3 is never open. Setting navigation controller's InteractivePopGestureRecognizer.Enabled to false disallows the swipe altogether. The same problem is discussed and solved in Xamarin.iOS in the following article:
http://docs.telerik.com/devtools/ios/sidedrawer/sidedrawer-with-uinavigationcontroller

Best regards,
Ves
Telerik by Progress
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
0
Julian
Top achievements
Rank 1
answered on 29 Sep 2016, 07:01 AM

Hey Ves, 

I am using InteractivePopGestureRecognizer.Enabled = false already in my application. 

So am I right in my findings that I'll have to use an onAppearing event on every Page to solve my problem?

Best regards

Julian

0
Ves
Telerik team
answered on 04 Oct 2016, 06:22 AM
Hi Julian,

There is a RaSideDrawer on every page. Whether it is populated in the page constructor or in OnAppearing is not much of a difference, as long as it serves the purpose.

Frankly, in this case, I was not able to swipe from right, so I am a bit curious what's your setup (if different from the sample you already provided)

Best regards,
Ves
Telerik by Progress
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
Tags
SideDrawer
Asked by
Julian
Top achievements
Rank 1
Answers by
Julian
Top achievements
Rank 1
Ves
Telerik team
Share this question
or