combine if statements

This commit is contained in:
Jonas Sourlier 2022-10-27 10:27:55 +02:00
parent bb0f679c6b
commit 878ac29fe0
2 changed files with 4 additions and 10 deletions

View file

@ -89,12 +89,9 @@ namespace SafeExamBrowser.UserInterface.Desktop.Windows
{ {
Activate(); Activate();
if (forward) if (forward && ApplicationStackPanel.Children.Count > 0)
{ {
if (ApplicationStackPanel.Children.Count > 0) SetFocusWithin(ApplicationStackPanel.Children[0]);
{
SetFocusWithin(ApplicationStackPanel.Children[0]);
}
} }
else else
{ {

View file

@ -88,12 +88,9 @@ namespace SafeExamBrowser.UserInterface.Mobile.Windows
{ {
Activate(); Activate();
if (fromTop) if (fromTop && ApplicationStackPanel.Children.Count > 0)
{ {
if (ApplicationStackPanel.Children.Count > 0) ApplicationStackPanel.Children[0].Focus();
{
ApplicationStackPanel.Children[0].Focus();
}
} }
else else
{ {