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 ;
23
34namespace MaterialDesignThemes . Wpf . Behaviors ;
45
@@ -14,8 +15,13 @@ private void UpdateAttachedProperties()
1415 {
1516 if ( AssociatedObject is { } associatedObject )
1617 {
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 ) ;
1925 }
2026 }
2127
You can’t perform that action at this time.
0 commit comments