<Page
    x:Class="APKInstaller.Pages.InstallPage"
    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:helper="using:APKInstaller.Helpers"
    xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
    xmlns:sys="using:System"
    xmlns:viewmodels="using:APKInstaller.ViewModels"
    d:DataContext="{d:DesignInstance Type=viewmodels:InstallViewModel}"
    AllowDrop="True"
    DragOver="Page_DragOver"
    Drop="Page_Drop"
    NavigationCacheMode="Enabled"
    mc:Ignorable="d">
    <Grid Background="{ThemeResource SystemControlTransparentBrush}">
        <Grid.ChildrenTransitions>
            <TransitionCollection>
                <EntranceThemeTransition />
            </TransitionCollection>
        </Grid.ChildrenTransitions>
        <Grid
            x:Name="CoreAppUI"
            Grid.Row="1"
            Margin="0,16,0,0"
            Visibility="{Binding IsInitialized, Mode=OneWay}">
            <Grid.Resources>
                <MenuFlyout x:Key="IconMenuFlyout">
                    <MenuFlyoutSubItem x:Uid="/InstallPage/CopyFlyoutItem">
                        <MenuFlyoutSubItem.Icon>
                            <FontIcon Glyph="&#xE8C8;" />
                        </MenuFlyoutSubItem.Icon>
                        <MenuFlyoutItem
                            x:Uid="/InstallPage/IconFlyoutItem"
                            Click="CopyBitmapItem_Click"
                            Tag="{Binding ApkInfo.Icon.RealPath}">
                            <MenuFlyoutItem.Icon>
                                <FontIcon Glyph="&#xECAA;" />
                            </MenuFlyoutItem.Icon>
                        </MenuFlyoutItem>
                        <MenuFlyoutSubItem
                            x:Name="InfosFlyoutItem"
                            x:Uid="/InstallPage/InfosFlyoutItem"
                            x:Load="{x:Bind Provider.ApkInfo.IsEmpty, FallbackValue=true, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}"
                            Visibility="{Binding ApkInfo.IsEmpty, FallbackValue=true, Converter={StaticResource BoolNegationConverter}, ConverterParameter='true'}">
                            <MenuFlyoutSubItem.Icon>
                                <FontIcon Glyph="&#xE946;" />
                            </MenuFlyoutSubItem.Icon>
                            <MenuFlyoutItem
                                x:Uid="/InstallPage/AppNameFlyoutItem"
                                Click="CopyStringItem_Click"
                                Tag="{Binding ApkInfo.AppName}">
                                <MenuFlyoutItem.Icon>
                                    <FontIcon Glyph="&#xED35;" />
                                </MenuFlyoutItem.Icon>
                            </MenuFlyoutItem>
                            <MenuFlyoutItem
                                x:Uid="/InstallPage/VersionCodeFlyoutItem"
                                Click="CopyStringItem_Click"
                                Tag="{Binding ApkInfo.VersionCode}">
                                <MenuFlyoutItem.Icon>
                                    <FontIcon Glyph="&#xEC7A;" />
                                </MenuFlyoutItem.Icon>
                            </MenuFlyoutItem>
                            <MenuFlyoutItem
                                x:Uid="/InstallPage/PackageNameFlyoutItem"
                                Click="CopyStringItem_Click"
                                Tag="{Binding ApkInfo.PackageName}">
                                <MenuFlyoutItem.Icon>
                                    <FontIcon Glyph="&#xE7B8;" />
                                </MenuFlyoutItem.Icon>
                            </MenuFlyoutItem>
                        </MenuFlyoutSubItem>
                        <MenuFlyoutItem
                            x:Name="APKFileFlyoutItem"
                            x:Uid="/InstallPage/APKFileFlyoutItem"
                            x:Load="{x:Bind Provider.ApkInfo.IsEmpty, FallbackValue=true, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}"
                            Click="CopyFileItem_Click"
                            Tag="{Binding ApkInfo.FullPath}"
                            Visibility="{Binding ApkInfo.IsEmpty, FallbackValue=true, Converter={StaticResource BoolNegationConverter}, ConverterParameter='true'}">
                            <MenuFlyoutItem.Icon>
                                <FontIcon Glyph="&#xE7B8;" />
                            </MenuFlyoutItem.Icon>
                        </MenuFlyoutItem>
                    </MenuFlyoutSubItem>
                    <MenuFlyoutSubItem
                        x:Name="ShareFlyoutItem"
                        x:Uid="/InstallPage/ShareFlyoutItem"
                        x:Load="{x:Bind Provider.ApkInfo.IsEmpty, FallbackValue=true, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}"
                        Visibility="{Binding ApkInfo.IsEmpty, FallbackValue=true, Converter={StaticResource BoolNegationConverter}, ConverterParameter='true'}">
                        <MenuFlyoutSubItem.Icon>
                            <FontIcon Glyph="&#xE72D;" />
                        </MenuFlyoutSubItem.Icon>
                        <MenuFlyoutItem
                            x:Uid="/InstallPage/APKFileFlyoutItem"
                            Click="ShareFileItem_Click"
                            Tag="{Binding ApkInfo.FullPath}">
                            <MenuFlyoutItem.Icon>
                                <FontIcon Glyph="&#xE7B8;" />
                            </MenuFlyoutItem.Icon>
                        </MenuFlyoutItem>
                        <MenuFlyoutSubItem x:Uid="/InstallPage/StoreLinkFlyoutItem">
                            <MenuFlyoutSubItem.Icon>
                                <FontIcon Glyph="&#xE71B;" />
                            </MenuFlyoutSubItem.Icon>
                            <MenuFlyoutItem
                                Click="ShareUrlItem_Click"
                                Tag="{x:Bind sys:String.Format('https://play.google.com/store/apps/details?id={0}', Provider.ApkInfo.PackageName), Mode=OneWay}"
                                Text="Google Play" />
                            <MenuFlyoutItem
                                Click="ShareUrlItem_Click"
                                Tag="{x:Bind sys:String.Format('https://f-droid.org/packages/{0}', Provider.ApkInfo.PackageName), Mode=OneWay}"
                                Text="F-Droid" />
                            <MenuFlyoutItem
                                Click="ShareUrlItem_Click"
                                Tag="{x:Bind sys:String.Format('https://www.coolapk.com/apps/{0}', Provider.ApkInfo.PackageName), Mode=OneWay}"
                                Text="Coolapk" />
                            <MenuFlyoutItem
                                Click="ShareUrlItem_Click"
                                Tag="{x:Bind sys:String.Format('https://www.amazon.com/gp/mas/dl/android?p={0}', Provider.ApkInfo.PackageName), Mode=OneWay}"
                                Text="Amazon" />
                        </MenuFlyoutSubItem>
                    </MenuFlyoutSubItem>
                    <MenuFlyoutItem
                        x:Name="MoreInfoFlyoutItem"
                        x:Uid="/InstallPage/MoreInfoFlyoutItem"
                        x:Load="{x:Bind Provider.ApkInfo.IsEmpty, FallbackValue=true, Converter={StaticResource BoolNegationConverter}, Mode=OneWay}"
                        Click="Button_Click"
                        Visibility="{Binding ApkInfo.IsEmpty, FallbackValue=true, Converter={StaticResource BoolNegationConverter}, ConverterParameter='true'}">
                        <MenuFlyoutItem.Icon>
                            <FontIcon Glyph="&#xE946;" />
                        </MenuFlyoutItem.Icon>
                    </MenuFlyoutItem>
                </MenuFlyout>
            </Grid.Resources>
            <Grid.RowDefinitions>
                <RowDefinition Height="*" />
                <RowDefinition Height="Auto" />
            </Grid.RowDefinitions>
            <Grid
                x:Name="MainContentContainer"
                Grid.Row="0"
                Margin="24,0,24,0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>
                <Grid
                    x:Name="TopInformation"
                    Grid.Column="0"
                    VerticalAlignment="Stretch">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <TextBlock
                        x:Name="AppName"
                        Grid.Row="0"
                        FontSize="{ThemeResource PivotHeaderItemFontSize}"
                        FontWeight="SemiLight"
                        OpticalMarginAlignment="TrimSideBearings"
                        Text="{Binding AppName}"
                        TextWrapping="Wrap"
                        ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}" />
                    <StackPanel
                        x:Name="AppSignatureInfoCotainer"
                        Grid.Row="1"
                        x:Load="False"
                        Orientation="Horizontal"
                        Visibility="Collapsed">
                        <Image x:Name="AppSignatureInfoImage" Stretch="Uniform" />
                        <TextBlock
                            x:Name="AppSignatureInfoText"
                            Margin="0,6,0,0"
                            MaxLines="1"
                            Text="Trusted App"
                            TextTrimming="CharacterEllipsis"
                            ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}" />
                    </StackPanel>
                    <TextBlock
                        x:Name="AppPublisher"
                        Grid.Row="2"
                        MaxLines="2"
                        Text="{x:Bind sys:String.Format(Provider.PackageNameFormat, Provider.ApkInfo.PackageName), Mode=OneWay}"
                        TextTrimming="CharacterEllipsis"
                        ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}"
                        Visibility="{Binding AppPublisherVisibility}" />
                    <TextBlock
                        x:Name="AppVersion"
                        Grid.Row="3"
                        Text="{x:Bind sys:String.Format(Provider.VersionFormat, Provider.ApkInfo.VersionName), Mode=OneWay}"
                        ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}"
                        Visibility="{Binding AppVersionVisibility}" />
                    <Grid Grid.Row="4" Margin="0,24,0,0">
                        <controls:CapabilitiesInfoControl
                            x:Name="AppCapabilities"
                            x:Uid="/InstallPage/AppCapabilities"
                            CapabilitiesList="{Binding ApkInfo.Permissions, Mode=OneWay}"
                            Visibility="{Binding AppCapabilitiesVisibility}" />
                    </Grid>
                </Grid>
                <Border
                    x:Name="AppIconContainer"
                    Grid.Column="1"
                    Width="90"
                    Height="90"
                    Margin="12,0,0,0"
                    HorizontalAlignment="Right"
                    VerticalAlignment="Top">
                    <Image
                        x:Name="AppIcon"
                        ContextFlyout="{StaticResource IconMenuFlyout}"
                        Source="{Binding ApkInfo.Icon.RealPath}" />
                </Border>
            </Grid>
            <Grid
                x:Name="AppBigPictureMainContentContainer"
                Grid.Row="0"
                x:Load="False"
                Visibility="Collapsed">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <TextBlock
                    x:Name="AppBigPictureMainContentText"
                    Grid.Row="0"
                    HorizontalAlignment="Center"
                    FontSize="{ThemeResource PivotHeaderItemFontSize}"
                    FontWeight="SemiBold"
                    MaxLines="2"
                    OpticalMarginAlignment="TrimSideBearings"
                    Text="{x:Bind sys:String.Format(Provider.InstallFormat, Provider.ApkInfo.AppName), Mode=OneWay}"
                    TextTrimming="CharacterEllipsis"
                    ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}" />
                <Image
                    x:Name="AppBigPicture"
                    Grid.Row="1"
                    Width="150"
                    Height="150"
                    HorizontalAlignment="Center"
                    ContextFlyout="{StaticResource IconMenuFlyout}"
                    Source="{Binding ApkInfo.Icon.RealPath}" />
            </Grid>
            <Grid
                x:Name="BottomContentContainer"
                Grid.Row="2"
                Margin="24,0,24,24">
                <Grid.RowDefinitions>
                    <RowDefinition Height="*" />
                    <RowDefinition Height="*" />
                    <RowDefinition Height="*" />
                </Grid.RowDefinitions>
                <StackPanel
                    x:Name="InstallProgressContainer"
                    Grid.Row="0"
                    Margin="0,24,0,0"
                    Opacity="1"
                    Visibility="{Binding IsInstalling, Mode=OneWay, Converter={StaticResource BoolToVisibilityConverter}}">
                    <TextBlock
                        x:Name="ProgressText"
                        Text="{Binding ProgressText}"
                        TextTrimming="CharacterEllipsis"
                        ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}" />
                    <ProgressBar
                        x:Name="AppxInstallBar"
                        Height="12"
                        IsIndeterminate="{Binding AppxInstallBarIndeterminate}"
                        Value="{Binding AppxInstallBarValue}" />
                </StackPanel>
                <Grid
                    x:Name="OutputInfoContainer"
                    Grid.Row="1"
                    Margin="0,10,0,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="Auto" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <Grid
                        x:Name="MessagesToUserContainer"
                        Margin="0,10,0,0"
                        Visibility="{Binding MessagesToUserVisibility}">
                        <Grid.RowDefinitions>
                            <RowDefinition Height="Auto" />
                            <RowDefinition Height="*" />
                        </Grid.RowDefinitions>
                        <TextBlock
                            x:Name="InfoMessageTextBlock"
                            Grid.Row="0"
                            Margin="0,0,0,6"
                            Text="{Binding InfoMessage}"
                            TextWrapping="WrapWholeWords"
                            ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}" />
                        <TextBlock
                            x:Name="WarningMessageModificationPackage"
                            Grid.Row="1"
                            Margin="0,0,0,6"
                            x:Load="False"
                            FontWeight="Bold"
                            TextWrapping="WrapWholeWords"
                            ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}"
                            Visibility="Collapsed" />
                    </Grid>
                    <TextBlock
                        x:Name="InstallOutputTextBlock"
                        x:Uid="/InstallPage/InstallOutputTextBlock"
                        Grid.Row="0"
                        Margin="0,0,0,6"
                        TextWrapping="WrapWholeWords"
                        ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}"
                        Visibility="{Binding InstallOutputVisibility}" />
                    <ScrollViewer
                        x:Name="TextOutputScrollViewer"
                        Grid.Row="1"
                        MaxHeight="56"
                        BorderBrush="{StaticResource SystemAccentColor}"
                        BorderThickness="3,3,3,3"
                        ScrollViewer.VerticalScrollBarVisibility="Auto"
                        Visibility="{Binding TextOutputVisibility}">
                        <TextBlock
                            x:Name="TextOutput"
                            Margin="6,6,6,6"
                            IsTextSelectionEnabled="True"
                            Text="{Binding TextOutput}"
                            TextWrapping="WrapWholeWords"
                            ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}" />
                    </ScrollViewer>
                </Grid>
                <Grid Grid.Row="2" Margin="0,20,0,0">
                    <Grid.RowDefinitions>
                        <RowDefinition Height="*" />
                        <RowDefinition Height="*" />
                        <RowDefinition Height="*" />
                    </Grid.RowDefinitions>
                    <ScrollViewer
                        Grid.Row="0"
                        HorizontalAlignment="Right"
                        HorizontalScrollBarVisibility="Auto"
                        VerticalScrollBarVisibility="Disabled">
                        <StackPanel x:Name="ButtonsContainer" Orientation="Horizontal">
                            <Button
                                x:Name="ActionButton"
                                Width="120"
                                Height="32"
                                Margin="12,0,0,0"
                                Click="Button_Click"
                                IsEnabled="{Binding ActionButtonEnable}"
                                Style="{StaticResource AccentButtonStyle}"
                                TabIndex="1"
                                Visibility="{Binding ActionVisibility}">
                                <StackPanel Orientation="Horizontal">
                                    <Image
                                        x:Name="ActionButtonImage"
                                        x:Load="False"
                                        Stretch="Uniform" />
                                    <TextBlock
                                        x:Name="ActionButtonText"
                                        Text="{Binding ActionButtonText}"
                                        ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}" />
                                </StackPanel>
                            </Button>
                            <HyperlinkButton
                                x:Name="HyperLinkButton"
                                Width="120"
                                Height="32"
                                Margin="12,0,0,0"
                                x:Load="False"
                                TabIndex="1"
                                Visibility="Collapsed" />
                            <Button
                                x:Name="SecondaryActionButton"
                                Width="120"
                                Height="32"
                                Margin="12,0,0,0"
                                Click="Button_Click"
                                IsEnabled="{Binding SecondaryActionButtonEnable}"
                                Style="{StaticResource AccentButtonStyle}"
                                TabIndex="1"
                                Visibility="{Binding SecondaryActionVisibility}">
                                <StackPanel>
                                    <Image
                                        x:Name="SecondaryActionButtonImage"
                                        x:Load="False"
                                        Stretch="Uniform" />
                                    <TextBlock
                                        x:Name="SecondaryActionButtonText"
                                        Text="{Binding SecondaryActionButtonText}"
                                        ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}" />
                                </StackPanel>
                            </Button>
                            <HyperlinkButton
                                x:Name="SecondaryHyperLinkButton"
                                Width="120"
                                Height="32"
                                Margin="12,0,0,0"
                                x:Load="False"
                                TabIndex="1"
                                Visibility="Collapsed" />
                            <Button
                                x:Name="FileSelectButton"
                                Width="120"
                                Height="32"
                                Margin="12,0,0,0"
                                Click="Button_Click"
                                IsEnabled="{Binding FileSelectButtonEnable}"
                                Style="{StaticResource AccentButtonStyle}"
                                TabIndex="1"
                                Visibility="{Binding FileSelectVisibility}">
                                <StackPanel Orientation="Horizontal">
                                    <Image
                                        x:Name="FileSelectButtonImage"
                                        x:Load="False"
                                        Stretch="Uniform" />
                                    <TextBlock
                                        x:Name="FileSelectButtonText"
                                        Text="{Binding FileSelectButtonText}"
                                        ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}" />
                                </StackPanel>
                            </Button>
                            <Button
                                x:Name="DownloadButton"
                                Width="120"
                                Height="32"
                                Margin="12,0,0,0"
                                Click="Button_Click"
                                IsEnabled="{Binding DownloadButtonEnable}"
                                Style="{StaticResource AccentButtonStyle}"
                                TabIndex="1"
                                Visibility="{Binding DownloadVisibility}">
                                <StackPanel Orientation="Horizontal">
                                    <Image
                                        x:Name="DownloadButtonImage"
                                        x:Load="False"
                                        Stretch="Uniform" />
                                    <TextBlock
                                        x:Name="DownloadButtonText"
                                        Text="{Binding DownloadButtonText}"
                                        ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}" />
                                </StackPanel>
                            </Button>
                            <Button
                                x:Name="CancelOperationButton"
                                Width="120"
                                Height="32"
                                Margin="12,0,0,0"
                                Click="Button_Click"
                                IsEnabled="{Binding CancelOperationButtonEnable}"
                                Style="{StaticResource AccentButtonStyle}"
                                TabIndex="1"
                                Visibility="{Binding CancelOperationVisibility}">
                                <Button.Flyout>
                                    <Flyout x:Name="CancelFlyout" x:FieldModifier="Public">
                                        <StackPanel>
                                            <TextBlock
                                                x:Name="ConfirmationText"
                                                x:Uid="/InstallPage/ConfirmationText"
                                                Margin="0,0,0,12"
                                                Style="{ThemeResource BaseTextBlockStyle}" />
                                            <RelativePanel>
                                                <Button
                                                    x:Name="CancelConfirmButton"
                                                    x:Uid="/InstallPage/CancelConfirmButton"
                                                    MinWidth="80"
                                                    Margin="120,5,0,0"
                                                    Click="Button_Click" />
                                                <Button
                                                    x:Name="CancelContinueButton"
                                                    x:Uid="/InstallPage/CancelContinueButton"
                                                    MinWidth="80"
                                                    Margin="12,5,0,0"
                                                    Click="Button_Click"
                                                    RelativePanel.RightOf="CancelConfirmButton" />
                                            </RelativePanel>
                                        </StackPanel>
                                    </Flyout>
                                </Button.Flyout>
                                <StackPanel>
                                    <Image
                                        x:Name="CancelOperationButtonImage"
                                        x:Load="False"
                                        Stretch="Uniform" />
                                    <TextBlock
                                        x:Name="CancelOperationButtonText"
                                        Text="{Binding CancelOperationButtonText}"
                                        ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}" />
                                </StackPanel>
                            </Button>
                            <Button
                                x:Name="DeviceSelectButton"
                                Width="120"
                                Height="32"
                                Margin="12,0,0,0"
                                Click="Button_Click"
                                IsEnabled="{Binding DeviceSelectButtonEnable}"
                                Style="{StaticResource AccentButtonStyle}"
                                TabIndex="1"
                                Visibility="{Binding DeviceSelectVisibility}">
                                <StackPanel Orientation="Horizontal">
                                    <Image
                                        x:Name="DeviceSelectButtonImage"
                                        x:Load="False"
                                        Stretch="Uniform" />
                                    <TextBlock
                                        x:Name="DeviceSelectButtonText"
                                        Text="{Binding DeviceSelectButtonText}"
                                        ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Text}" />
                                </StackPanel>
                            </Button>
                        </StackPanel>
                    </ScrollViewer>
                    <CheckBox
                        x:Name="LaunchWhenReadyCheckbox"
                        x:Uid="/InstallPage/LaunchWhenReadyCheckbox"
                        Grid.Row="1"
                        Margin="0,-26,0,0"
                        Padding="8,5,0,0"
                        HorizontalAlignment="Left"
                        VerticalAlignment="Center"
                        HorizontalContentAlignment="Left"
                        VerticalContentAlignment="Top"
                        FocusVisualMargin="-7,-3"
                        IsChecked="{Binding IsOpenApp, Mode=TwoWay}"
                        ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Content}"
                        UseSystemFocusVisuals="True"
                        Visibility="{Binding LaunchWhenReadyVisibility}" />
                    <StackPanel
                        x:Name="TermsAndConditionsGrid"
                        Grid.Row="2"
                        x:Load="False"
                        Visibility="Collapsed">
                        <HyperlinkButton
                            x:Name="MoreDetailsHyperLink"
                            HorizontalAlignment="Center"
                            Content="See more"
                            ToolTipService.ToolTip="{Binding RelativeSource={RelativeSource Self}, Path=Content}" />
                    </StackPanel>
                </Grid>
            </Grid>
        </Grid>
        <StackPanel
            x:Name="InitialLoadingUI"
            Grid.Row="1"
            HorizontalAlignment="Center"
            VerticalAlignment="Center"
            Loaded="InitialLoadingUI_Loaded"
            Visibility="{Binding IsInitialized, Converter={StaticResource BoolToVisibilityConverter}, ConverterParameter='true'}">
            <ProgressRing
                x:Name="WaitProgressRing"
                Width="50"
                Height="50"
                HorizontalAlignment="Center"
                IsActive="True"
                IsIndeterminate="{Binding WaitProgressIndeterminate}"
                Value="{Binding WaitProgressValue}" />
            <TextBlock
                x:Name="WaitProgressText"
                Margin="0,6,0,0"
                Text="{Binding WaitProgressText}"
                TextAlignment="Center"
                TextWrapping="Wrap" />
        </StackPanel>
    </Grid>
</Page>
