Binding 2 independent ViewModel

Hi,

I have a technical issue. Could you help me?

It doesn't work when I binding  View Model 1 (VM1) and View Model 2 (VM2)?

image.png

My idea is:
 when I choose Tool_01, VM1 is visible and VM2 collapse
 when I choose Tool_02, VM2 is visible and VM1 collapse

But the issue is when I choose Tool_01 or Tool_02, both are visible.

Please find the link below for your reference.


Thanks in advance!

Attachment: StandardProject_8c9be0d7.rar

3 Replies 1 reply marked as answer

RS Ruba Shanmugam Syncfusion Team June 6, 2022 01:58 PM UTC

Hi Nam,


We have validated the reported query “Binding two independent ViewModel”. In the provided sample, you are setting the DataContext inside the view on the User control, so the Visibility on the ViewModel DataContext is not working. Now we have changed your content view to remove one view and add the other view to the content. Please get the sample from the attachments.


Please let us know if you need any details.


Regards,

Ruba Shanmugam


Attachment: NavigationDrawer_Modified_2b196662.zip

Marked as answer

NA Nam June 9, 2022 05:53 AM UTC

Thanks! It's really helpful for me.



RS Ruba Shanmugam Syncfusion Team June 10, 2022 07:24 AM UTC

Hi Nam,


You are welcome.


Please let us know if you have any other further assistance on this.


Regards,

Ruba Shanmugam


Loader.
Up arrow icon