File tree Expand file tree Collapse file tree 1 file changed +7
-9
lines changed
src/MaterialDesignThemes.Wpf Expand file tree Collapse file tree 1 file changed +7
-9
lines changed Original file line number Diff line number Diff line change @@ -393,18 +393,16 @@ private static void IsOpenPropertyChangedCallback(DependencyObject dependencyObj
393393 dialogHost . DialogOpenedCallback ? . Invoke ( dialogHost , dialogOpenedEventArgs ) ;
394394 dialogHost . _asyncShowOpenedEventHandler ? . Invoke ( dialogHost , dialogOpenedEventArgs ) ;
395395
396- dialogHost . Dispatcher . BeginInvoke ( DispatcherPriority . Background , new Action ( ( ) =>
397- {
396+ //https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/issues/187
397+ //totally not happy about this, but on immediate validation we can get some weird looking stuff...give WPF a kick to refresh...
398+ Task . Delay ( 300 ) . ContinueWith ( t => dialogHost . Dispatcher . BeginInvoke ( DispatcherPriority . Background , new Action ( ( ) => {
398399 CommandManager . InvalidateRequerySuggested ( ) ;
400+ //Delay focusing the popup until after the animation has some time, Issue #2912
399401 UIElement ? child = dialogHost . FocusPopup ( ) ;
400402
401- if ( child != null )
402- {
403- //https://github.com/MaterialDesignInXAML/MaterialDesignInXamlToolkit/issues/187
404- //totally not happy about this, but on immediate validation we can get some weird looking stuff...give WPF a kick to refresh...
405- Task . Delay ( 300 ) . ContinueWith ( t => child . Dispatcher . BeginInvoke ( new Action ( ( ) => child . InvalidateVisual ( ) ) ) ) ;
406- }
407- } ) ) ;
403+ child ? . InvalidateVisual ( ) ;
404+
405+ } ) ) ) ;
408406 }
409407
410408 /// <summary>
You can’t perform that action at this time.
0 commit comments