A quick decompile of the TextBox
code shows that LineCount
is not a DependencyProperty
. So when the value is updated it will not update your trigger.
This is LineCount
property from the System.Windows.Controls.TextBox
class in C#. You can see here that there is not DependencyProperty
backing the property.
[DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)]
public int LineCount
{
get
{
if (this.RenderScope == null)
return -1;
else
return this.GetLineIndexFromCharacterIndex(this.TextContainer.SymbolCount) + 1;
}
}
The answer to this question as a decent solution for creating an attached property that will observe when the text in the TextBox
is modified, and give the current line position. You can change your binding to listen for the attached property.