Another Binding issue...

Oct 18, 2014 at 9:02 PM
Edited Oct 18, 2014 at 11:22 PM
I am attempting to bind the Visibility property of a control on my main window to a bool property on my RibbonControl being hosted inside the MainWindow.

I have this attached to the Main Window:
<MHManager:NavigationControl x:Name="navigationPane" Grid.Row="1" Grid.Column="0" DockPanel.Dock="Left" Visibility="{Binding DataContext.NavVisible, ElementName=ribbonControl, Converter={con:BooleanToVisibilityConverter}}"/>
As you can see I am setting my converter to the one defined inside my resources, I'm attaching the NavVisible DataContext and telling it the location of the NavVisible.

Inside my RibbonControl I am using INotifyPropertyChanged:
public partial class RibbonControl : UserControl, INotifyPropertyChanged
{

 private bool _navVisible = true;

        public event PropertyChangedEventHandler PropertyChanged;
                
        private void NotifyPropertyChanged(String info)
        {
            if (PropertyChanged != null)
            {
                PropertyChanged(this, new PropertyChangedEventArgs(info));
            }
        }

        public bool NavVisible
        {
            get
            {
                return this._navVisible;
            }

            set
            {
                if (value != this._navVisible)
                {
                    this._navVisible = value;
                    NotifyPropertyChanged("NavVisible");
                }
            }
        }
On initial Run this works fine making the navigation pane collapsed, but when I try setting the value to true later it doesn't change.

This forks fine if I set it to true initially and false after I load the Database in and get no errors. But the screens

Th2k2w"mmm m error I get is "'' is not a valid value for property 'Padding'."

Any help is appreciated.
Oct 18, 2014 at 11:31 PM
I think I figured it out guys.

It's a bug with the NavigationPane Control and it's Visibility setting. I can remove that bind code from that control and leave the same bind for the statusbar and it works like it's supposed too.
Marked as answer by batzen on 10/19/2014 at 8:37 AM