Title property of ViewModel

Topics: Questions
Aug 15, 2013 at 10:40 AM
Edited Aug 15, 2013 at 11:10 AM
should i specify Title property for all viewmodels? when i don't specify it, then in output window i get the following binding error:
System.Windows.Data Error: 5 : Value produced by BindingExpression is not valid for target property.; Value='<null>' BindingExpression:Path=Title; DataItem='AuthenticationViewModel' (HashCode=61705608); target element is 'AuthenticationView' (Name=''); target property is 'Title' (type 'String')
Aug 15, 2013 at 1:10 PM
No, it should work automatically. If you override the Title property on a VM, does it show the title on the window?
Aug 15, 2013 at 1:15 PM
yes when i override it, the title show on the window. but i don't want it. i want empty title.
and when i don't override it, then get the binding error.
Aug 15, 2013 at 1:17 PM
So you are saying that as soon as you override it, the binding error is gone? That is really weird because that should not be a difference between on which class in an inheritance tree a property is defined.

You can just return string.Empty in the overridden property, but that shouldn't be necessary.
Aug 15, 2013 at 1:25 PM
Yes this is really weird. Now i set String.Empty and binding errors is gone.