File tree Expand file tree Collapse file tree 1 file changed +9
-3
lines changed
src/MaterialDesignThemes.Wpf/Behaviors Expand file tree Collapse file tree 1 file changed +9
-3
lines changed Original file line number Diff line number Diff line change 1
- using Microsoft . Xaml . Behaviors ;
1
+ using System . Windows . Threading ;
2
+ using Microsoft . Xaml . Behaviors ;
2
3
3
4
namespace MaterialDesignThemes . Wpf . Behaviors ;
4
5
@@ -14,8 +15,13 @@ private void UpdateAttachedProperties()
14
15
{
15
16
if ( AssociatedObject is { } associatedObject )
16
17
{
17
- associatedObject . SetCurrentValue ( TextFieldAssist . TextBoxLineCountProperty , associatedObject . LineCount ) ;
18
- associatedObject . SetCurrentValue ( TextFieldAssist . TextBoxIsMultiLineProperty , associatedObject . LineCount > 1 ) ;
18
+ associatedObject . Dispatcher
19
+ . BeginInvoke ( ( ) =>
20
+ {
21
+ associatedObject . SetCurrentValue ( TextFieldAssist . TextBoxLineCountProperty , associatedObject . LineCount ) ;
22
+ associatedObject . SetCurrentValue ( TextFieldAssist . TextBoxIsMultiLineProperty , associatedObject . LineCount > 1 ) ;
23
+ } ,
24
+ DispatcherPriority . Background ) ;
19
25
}
20
26
}
21
27
You can’t perform that action at this time.
0 commit comments