We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 32e2584 commit 0ff7d5dCopy full SHA for 0ff7d5d
src/MaterialDesignThemes.Wpf/Behaviors/TextBoxLineCountBehavior.cs
@@ -12,8 +12,11 @@ public class TextBoxLineCountBehavior : Behavior<TextBox>
12
13
private void UpdateAttachedProperties()
14
{
15
- AssociatedObject.SetCurrentValue(TextFieldAssist.TextBoxLineCountProperty, AssociatedObject.LineCount);
16
- AssociatedObject.SetCurrentValue(TextFieldAssist.TextBoxIsMultiLineProperty, AssociatedObject.LineCount > 1);
+ if (AssociatedObject != null)
+ {
17
+ AssociatedObject.SetCurrentValue(TextFieldAssist.TextBoxLineCountProperty, AssociatedObject.LineCount);
18
+ AssociatedObject.SetCurrentValue(TextFieldAssist.TextBoxIsMultiLineProperty, AssociatedObject.LineCount > 1);
19
+ }
20
}
21
22
protected override void OnAttached()
0 commit comments