I am trying to bind ToolTip property to a (Validation.Errors).CurrentItem in code. I allready did that with DataGrid like:
var grid = new FrameworkElementFactory(typeof(Grid));
grid.SetValue(Grid.ToolTipProperty, new Binding() {
RelativeSource = new RelativeSource(RelativeSourceMode.FindAncestor, typeof(DataGridRow), 1),
Path = new PropertyPath("(Validation.Errors).CurrentItem.ErrorContent")
});
That works, error sign appears in row header with tool tip (some error text).
When I try to do the same with text box tool tip does not appear:
grid.SetValue(Grid.ToolTipProperty, new Binding() {
ElementName = textBox1.Name, // tried with relative source also...
Path = new PropertyPath("(Validation.Errors).CurrentItem.ErrorContent")
});
Regards,
Vale