Skip to content

Commit e518db1

Browse files
committed
Add __CloseAppInvoker button
1 parent f7620c3 commit e518db1

File tree

2 files changed

+29
-9
lines changed

2 files changed

+29
-9
lines changed

UITests/UITests.App/MainTestHost.xaml

Lines changed: 24 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,33 @@
66
xmlns:testhelpers="using:AppTestAutomationHelpers"
77
Background="{ThemeResource ApplicationPageBackgroundThemeBrush}"
88
mc:Ignorable="d">
9+
<Page.Resources>
10+
<Style x:Key="AutomationHelperStyle"
11+
TargetType="Control">
12+
<Setter Property="IsTabStop" Value="False" />
13+
<Setter Property="IsHitTestVisible" Value="False" />
14+
<Setter Property="Width" Value="0" />
15+
<Setter Property="Height" Value="0" />
16+
<Setter Property="Opacity" Value="0" />
17+
</Style>
18+
</Page.Resources>
919

1020
<Grid>
1121
<testhelpers:TestAutomationHelpersPanel />
12-
<Button x:Name="GoBackInvokerButton"
13-
Width="0"
14-
Height="0"
15-
AutomationProperties.AutomationId="__GoBackInvoker"
16-
IsHitTestVisible="False"
17-
IsTabStop="False"
18-
Click="GoBackInvokerButton_Click"
19-
Opacity="0" />
20-
22+
<StackPanel Width="0"
23+
Height="0"
24+
HorizontalAlignment="Stretch"
25+
VerticalAlignment="Top"
26+
Orientation="Horizontal">
27+
<Button x:Name="GoBackInvokerButton"
28+
AutomationProperties.AutomationId="__GoBackInvoker"
29+
Click="GoBackInvokerButton_Click"
30+
Style="{StaticResource AutomationHelperStyle}" />
31+
<Button x:Name="CloseAppInvokerButton"
32+
AutomationProperties.AutomationId="__CloseAppInvoker"
33+
Click="CloseAppInvokerButton_Click"
34+
Style="{StaticResource AutomationHelperStyle}" />
35+
</StackPanel>
2136
<Frame x:Name="navigationFrame"
2237
IsNavigationStackEnabled="False"
2338
Navigated="NavigationFrame_Navigated"

UITests/UITests.App/MainTestHost.xaml.cs

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,5 +121,10 @@ private void GoBackInvokerButton_Click(object sender, RoutedEventArgs e)
121121
navigationFrame.Navigate(typeof(HomePage));
122122
Log.Comment("Navigated to Page.");
123123
}
124+
125+
private void CloseAppInvokerButton_Click(object sender, RoutedEventArgs e)
126+
{
127+
App.Current.Exit();
128+
}
124129
}
125130
}

0 commit comments

Comments
 (0)