We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy. Image for the cookie policy date

SfNavigationDrawer.ContentView problem with binding two ContentView

Hi, first sorry for my bad english.  
I'm got trouble with this in my project. Let say i have two ContentView - A and B. And in NavigationDrawer Menu i have two item is 1 and 2.

The Item 1 will make ContentView A IsVisible and ContView B is not, Item 2 will do the opposite.

The ContentPage containt NavigationDrawer is binding ViewModel C.

But then,  ContentView A and B is binding another ViewModel. So the property IsVisible of ContentView A and B is not available on ContentPage when binding with ViewModel C.

If im not binding ViewModel for ContentView A and B it's will work fine. So how can i fix this ?


                 
 

4 Replies

KI Kien.Phat November 17, 2019 09:34 AM UTC

Here is my code:

<navigationdrawer:SfNavigationDrawer.ContentView>
            <Grid BackgroundColor="Transparent">
                 
                <view:ContentViewB IsVisible="{Binding ContentViewVisible,Converter={StaticResource boolToBoolConventer}}"/>
                <view1:DuyetHoaDon  IsVisible="{Binding ContentViewVisible}" />
                
            </Grid>
</navigationdrawer:SfNavigationDrawer.ContentView>


RA Rachel A Syncfusion Team November 18, 2019 12:29 PM UTC

Hi Kien, 
 
Greetings from Syncfusion. 
 
We have prepared the sample to achieve the switching of two content views in SfNavigationDrawer. Please try the attached sample from the below link. 
  
 
Screenshots: 
 
          
 
Thanks, 
Rachel. 



KI Kien.Phat November 19, 2019 03:10 AM UTC

Hi Rachel,

Thank for your supports the problem was solved.


RA Rachel A Syncfusion Team November 19, 2019 08:54 AM UTC

Hi Kien, 
 
Thank you for the confirmation. 
 
Regards, 
Rachel. 


Loader.
Up arrow icon