C#C
C#3y ago
10 replies
mauriziopatino

WPF Visibility binding seems that is not setting style

Hi, i have a vertical navigation bar which my <Border> tag is binded to "IsNavBarVisible":

Inside of the Border i have a Grid with the width, background color defined and all the definitions of buttons, icons and their references to static resource design

<Border Grid.Column="0"
        Background="{StaticResource BackgroundColor}" Visibility="{Binding IsNavBarVisible}">


When my MainViewModel loads I set the property to false because the LoginViewModel appears:

public MainViewModel(...parms)
{
    ...parms
    _isNavBarVisible = "Hidden";

}


Then, when I run the LoginCommand in my LoginViewModel i set the property to "Visible":
_mainViewModel.IsNavBarVisible = "Visible";


But the problems it's that i just only get a white bar with width property but not the styles applied in my resource dictionary, any help?
image.png
Was this page helpful?