<UserControl xmlns="https://github.com/avaloniaui"
             xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
             xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
             xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
			 xmlns:cc="using:SPTInstaller.CustomControls"
             mc:Ignorable="d" d:DesignWidth="800" d:DesignHeight="450"
             x:Class="SPTInstaller.Views.PreChecksView">
	<Grid ColumnDefinitions="10,*,AUTO,*,10"
		  RowDefinitions="10,*,AUTO,AUTO,AUTO,AUTO,*,10">
		<StackPanel Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="2" HorizontalAlignment="Center">
			<Label Content="SPT will be installed into this folder:"
				   HorizontalAlignment="Center"
				   />
            <TextBlock Text="{Binding InstallPath}" TextWrapping="Wrap"
                       Foreground="DodgerBlue" HorizontalAlignment="Center"
                       />
            
			<Label Content="Move the installer into the folder you want it to install into if this is wrong"
				   HorizontalAlignment="Center"
				   />
		</StackPanel>
		<Button Grid.Column="2" Grid.Row="3" Content="Start Install" Padding="20 10"
				Margin="10"
				FontSize="15" FontWeight="SemiBold"
				Classes="yellow"
				IsEnabled="{Binding AllowInstall}"
				Command="{Binding StartInstallCommand}"
				/>
        
		<ItemsControl ItemsSource="{Binding PreChecks}" Grid.Column="1" Grid.ColumnSpan="3" Grid.Row="4" HorizontalAlignment="Center">
			<ItemsControl.ItemsPanel>
				<ItemsPanelTemplate>
					<WrapPanel/>
				</ItemsPanelTemplate>
			</ItemsControl.ItemsPanel>
			<ItemsControl.ItemTemplate>
				<DataTemplate>
					<cc:PreCheckItem PreCheckName="{Binding Name}"
									 IsRequired="{Binding IsRequired}"
                                     State="{Binding State}"
									 />
				</DataTemplate>
			</ItemsControl.ItemTemplate>
		</ItemsControl>
        
        <Button Grid.Column="1" Grid.Row="5" Grid.ColumnSpan="3" HorizontalAlignment="Center"
                Content="Detailed View"
                IsEnabled="{Binding AllowDetailsButton}"
                Command="{Binding ShowDetailedViewCommand}"
                />

        <cc:UpdateInfoCard Grid.Row="1" Grid.RowSpan="4" Padding="10"
                           VerticalAlignment="Top" HorizontalAlignment="Left"
                           InfoText="{Binding UpdateInfo.UpdateInfoText}"
                           ShowUpdateCard="{Binding UpdateInfo.ShowCard}"
                           NotNowCommand="{Binding DismissUpdateCommand}"
                           UpdateInstallerCommand="{Binding UpdateInstallerCommand}"
                           Updating="{Binding UpdateInfo.Updating}"
                           DownloadProgress="{Binding UpdateInfo.DownloadProgress}"
                           IndeterminateProgress="{Binding UpdateInfo.CheckingForUpdates}"
                           UpdateAvailable="{Binding UpdateInfo.UpdateAvailable}"
                           />
        
        <cc:CacheInfo Grid.Row="6" Grid.Column="1" Grid.ColumnSpan="3" Padding="10"
                      VerticalAlignment="Bottom" HorizontalAlignment="Left"
                      InfoText="{Binding CacheInfoText}" State="{Binding CacheCheckState}"
                      />
	</Grid>
</UserControl>