Binding to ViewModel not working

Hello Team Syncfusion,

I have a binding problem with the NavigationItem in the SfNavigationDrawer. Above the item everything works fine. But as soon as I bind from the ViewModel to the NavigationItem.Header, it is not valid.

View

 <Grid>

        <Button Content="{Binding IsWorking}">

        </Button>

        <syncfusion:SfNavigationDrawer x:Name="NavigationDrawer" DisplayMode="Expanded" Grid.Column="0">

            <syncfusion:NavigationItem

            Header="{Binding IsWorking}"

            IsSelected="True"

            IsExpanded="True">

                <syncfusion:NavigationItem

                    Header="{Binding IsNotWorking}"

                    DataContext="NavigationBarDataContext">

                </syncfusion:NavigationItem>

            </syncfusion:NavigationItem>

</Grid>

ViewModel

  public class NavigationBarViewModel : NotifyingObject

    {

        public string IsWorking { get; } = "Yes";

        public string IsNotWorking { get; } = "No";

    }


3 Replies

SS Suganya Sethuraman Syncfusion Team October 18, 2021 05:47 AM UTC

Hi Malte,

Greetings from Syncfusion.

We have analyzed the reported issue. We have prepared sample based on the information provided but we could not be able to reproduce the issue. Please have a sample and screenshot for your reference,

Sample: https://www.syncfusion.com/downloads/support/directtrac/general/ze/NavigationSample1638696232

Screenshot


Since we are not aware of your exact application scenario, so we request you to check the issue with the attached sample and let us know whether it is reproduced or not? If the issue was not reproduced in this sample, please revert us by modifying the sample based on your application along with replication procedure or provide the sample. It will help us to provide better solution at the earliest.

Regards,
Suganya Sethuraman.
 



MR Malte R replied to Suganya Sethuraman October 18, 2021 05:24 PM UTC

Awesone guys, it was my fault. Great Example, Thank you!

Regards, Malte



SS Suganya Sethuraman Syncfusion Team October 19, 2021 05:05 AM UTC

Hi Malte,

Thanks for the update.

We are glad that your issue is resolved. Please let us know if you require any further assistance.

Regards,
Suganya Sethuraman.
 


Loader.
Up arrow icon