Skip to content

Can't bind to ShowTitleBar #2877

@Blinxar

Description

@Blinxar

What steps will reproduce this issue?

I've bound the ShowTitleBar property on my window to a property on my view model

ShowTitleBar="{Binding ShowTitleBar}"

bool showTitleBar= false;
public bool ShowTitleBar
{
    get => showTitleBar;
    set => Set(ref showTitleBar, value);
}

protected virtual bool Set<T>(ref T property, T value, [CallerMemberName] string propName = null)
{
    if (EqualityComparer<T>.Default.Equals(property, value)) return false;
    RaisePropertyChanging(propName);
    property = value;
    RaisePropertyChanged(propName);
    return true;
}

The property on the window does take the initial value of the property on the view model, however, updating the property on the view model doesn't update the window.

Using snoop, there's no reference to the binding on the ShowTitleBarProperty

image

All other bindings are working. If I change the binding to IsEnabled="{Binding ShowTitleBar}" then it works as expected

image

  • MahApps.Metro v1.4.3
  • Windows OS: Windows 8.1 x64
  • Visual Studio 2017 RC
  • .NET Framework 4.5.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions