<Page
    x:Class="APKInstaller.Pages.SettingsPages.TestPage"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:controls="using:APKInstaller.Controls"
    xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
    xmlns:globalization="using:System.Globalization"
    xmlns:helper="using:APKInstaller.Helpers"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    NavigationCacheMode="Enabled"
    mc:Ignorable="d">
    <Grid>
        <Grid.Resources>
            <Style TargetType="controls:SettingsGroup">
                <Setter Property="Margin" Value="0,-28,0,0" />
            </Style>
        </Grid.Resources>
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>
        <controls:TitleBar
            x:Name="TitleBar"
            x:Uid="/TestPage/TitleBar"
            BackRequested="TitleBar_BackRequested"
            IsBackButtonVisible="True"
            IsBackEnabled="{x:Bind Frame.CanGoBack}"
            IsRefreshEnabled="True" />
        <ScrollViewer Grid.Row="1">
            <StackPanel Padding="16,0,16,16">
                <StackPanel.ChildrenTransitions>
                    <TransitionCollection>
                        <ReorderThemeTransition />
                    </TransitionCollection>
                </StackPanel.ChildrenTransitions>
                <controls:SettingsGroup Margin="0">
                    <InfoBar
                        x:Uid="/TestPage/DevelopmentInfoBar"
                        IsClosable="False"
                        IsOpen="{x:Bind IsDevelopment}"
                        Severity="Warning">
                        <InfoBar.ActionButton>
                            <HyperlinkButton
                                Click="Button_Click"
                                Content="Microsoft Store"
                                Tag="Store" />
                        </InfoBar.ActionButton>
                    </InfoBar>
                </controls:SettingsGroup>
                <controls:SettingsGroup x:Uid="/TestPage/UITestSettingsHeader">
                    <controls:Setting x:Uid="/TestPage/TitleBarSettings" Icon="&#xE737;">
                        <ToggleSwitch IsOn="{x:Bind IsExtendsTitleBar, Mode=TwoWay}" Style="{StaticResource ToggleSwitchSettingStyle}" />
                    </controls:Setting>
                    <controls:SettingExpander x:Uid="/TestPage/ProgressSettings" Icon="&#xF16A;">
                        <controls:SettingExpander.ActionContent>
                            <ToggleSwitch IsOn="{x:Bind IsShowProgressRing, Mode=TwoWay}" Style="{StaticResource ToggleSwitchSettingStyle}" />
                        </controls:SettingExpander.ActionContent>
                        <controls:Setting x:Uid="/TestPage/SetProgressValue" Style="{StaticResource DefaultSettingExpanderItemStyle}">
                            <Slider
                                Width="180"
                                HorizontalAlignment="Stretch"
                                VerticalAlignment="Center"
                                Maximum="100"
                                Value="{x:Bind ProgressValue, Mode=TwoWay}" />
                        </controls:Setting>
                        <controls:Setting x:Uid="/TestPage/ShowRefreshButton" Style="{StaticResource DefaultSettingExpanderItemStyle}">
                            <ToggleSwitch IsOn="{x:Bind TitleBar.IsRefreshButtonVisible, Mode=TwoWay}" Style="{StaticResource ToggleSwitchSettingStyle}" />
                        </controls:Setting>
                    </controls:SettingExpander>
                    <controls:Setting x:Uid="/TestPage/LanguageSettings" Icon="&#xF2B7;">
                        <ComboBox
                            ItemsSource="{x:Bind helper:LanguageHelper.SupportCultures}"
                            Loaded="ComboBox_Loaded"
                            SelectionChanged="ComboBox_SelectionChanged"
                            Tag="Language">
                            <ComboBox.ItemTemplate>
                                <DataTemplate x:DataType="globalization:CultureInfo">
                                    <TextBlock>
                                        <Run Text="{x:Bind DisplayName}" />
                                    </TextBlock>
                                </DataTemplate>
                            </ComboBox.ItemTemplate>
                        </ComboBox>
                    </controls:Setting>
                    <controls:Setting x:Uid="/TestPage/CompactOverlaySettings" Icon="&#xE944;">
                        <StackPanel
                            Margin="0,2"
                            Orientation="Horizontal"
                            Spacing="4">
                            <Button
                                x:Uid="/TestPage/EnterPIP"
                                Click="Button_Click"
                                Tag="EnterPIP" />
                            <Button
                                x:Uid="/TestPage/OutPIP"
                                Click="Button_Click"
                                Tag="OutPIP" />
                        </StackPanel>
                    </controls:Setting>
                </controls:SettingsGroup>
                <controls:SettingsGroup x:Uid="/TestPage/AndroidTestSettingsHeader">
                    <controls:Setting
                        x:Uid="/TestPage/ApplicationsSettings"
                        Click="Button_Click"
                        Icon="&#xE7B8;"
                        IsClickEnabled="True"
                        Tag="Applications" />
                    <controls:Setting
                        x:Uid="/TestPage/ProcessesSettings"
                        Click="Button_Click"
                        Icon="&#xE9D9;"
                        IsClickEnabled="True"
                        Tag="Processes" />
                </controls:SettingsGroup>
            </StackPanel>
        </ScrollViewer>
    </Grid>
</Page>
