UI/Console/HDTImportOperatingSystem.xaml
|
<!--
MDT'S Import Operating System WIZARD, on one page. MDT SPREADS IT OVER SIX - OS Type, Source, Destination, Summary, Progress, Confirmation - and the first of them asks a question this engine does not have: "full set of source files", "custom image file" or "Windows Deployment Services images". HDT imports an image FILE, so the type page would be a page with one answer on it. WHAT THE SOURCE IS, EXACTLY: the .wim or .ffu, not the folder holding it. On Windows media that is sources\install.wim. Import-HDTOperatingSystem reads the image list out of it through IImageService, which is why the catalog cannot disagree with the media - and why a folder is refused rather than guessed at. THE MEDIA IS REGISTERED WHERE IT STANDS. MDT's "Copy files" is not offered here: Import-HDTOperatingSystem's -Copy moves several gigabytes, and a console that did that on its dispatcher would grey out for minutes - the exact failure the boot image build's progress window exists to prevent. The hint says so and names the command, rather than a tick box that quietly freezes the window. NO x:Class AND NO CODE-BEHIND, as every other window here. Handlers are attached in PowerShell, by name. NAMED CONTROLS ARE THE CONTRACT with New-HDTConsoleHost: HDTImportOsTitleText, HDTImportOsRootText, HDTImportOsSourceBox, HDTImportOsSourceBrowseButton, HDTImportOsIdBox, HDTImportOsNameBox, HDTImportOsDescriptionBox, HDTImportOsMessageText, HDTImportOsCommandText, HDTImportOsImportButton and HDTCancelButton. --> <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="Import Operating System" Width="640" Height="520" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" ShowInTaskbar="False" Background="{DynamicResource HDTWindowBrush}" FontFamily="Segoe UI" FontSize="12"> <Window.Resources> <SolidColorBrush x:Key="HDTWindowBrush" Color="#FFF3F3F3" /> <SolidColorBrush x:Key="HDTBannerBrush" Color="#FF0E639C" /> <SolidColorBrush x:Key="HDTBannerTextBrush" Color="#FFFFFFFF" /> <SolidColorBrush x:Key="HDTBannerLabelBrush" Color="#FFD6E9F5" /> <SolidColorBrush x:Key="HDTPanelBrush" Color="#FFFFFFFF" /> <SolidColorBrush x:Key="HDTPanelTextBrush" Color="#FF1B1B1B" /> <SolidColorBrush x:Key="HDTBorderBrush" Color="#FFC8C8C8" /> <SolidColorBrush x:Key="HDTHintTextBrush" Color="#FF6B6B6B" /> <SolidColorBrush x:Key="HDTErrorBrush" Color="#FFA31515" /> <SolidColorBrush x:Key="HDTCommandTextBrush" Color="#FF0A3069" /> <SolidColorBrush x:Key="HDTFooterBrush" Color="#FFE8E8E8" /> <SolidColorBrush x:Key="HDTButtonBrush" Color="#FF0E639C" /> <SolidColorBrush x:Key="HDTButtonTextBrush" Color="#FFFFFFFF" /> <Style TargetType="TextBlock" x:Key="HDTFieldLabel"> <Setter Property="Foreground" Value="{DynamicResource HDTPanelTextBrush}" /> <Setter Property="FontSize" Value="12" /> <Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="Margin" Value="0,0,10,10" /> </Style> <Style TargetType="TextBlock" x:Key="HDTFieldHint"> <Setter Property="Foreground" Value="{DynamicResource HDTHintTextBrush}" /> <Setter Property="FontSize" Value="11" /> <Setter Property="TextWrapping" Value="Wrap" /> <Setter Property="Margin" Value="0,-6,0,10" /> </Style> <Style TargetType="TextBox"> <Setter Property="Background" Value="{DynamicResource HDTPanelBrush}" /> <Setter Property="Foreground" Value="{DynamicResource HDTPanelTextBrush}" /> <Setter Property="BorderBrush" Value="{DynamicResource HDTBorderBrush}" /> <Setter Property="BorderThickness" Value="1" /> <Setter Property="Padding" Value="6,5,6,5" /> <Setter Property="Margin" Value="0,0,0,10" /> <Setter Property="VerticalContentAlignment" Value="Center" /> </Style> <Style TargetType="Button"> <Setter Property="Background" Value="{DynamicResource HDTButtonBrush}" /> <Setter Property="Foreground" Value="{DynamicResource HDTButtonTextBrush}" /> <Setter Property="BorderThickness" Value="0" /> <Setter Property="Padding" Value="14,6,14,6" /> </Style> </Window.Resources> <Grid> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> </Grid.RowDefinitions> <!-- The console's banner, so this reads as part of the same tool. --> <Border Grid.Row="0" Background="{DynamicResource HDTBannerBrush}" Padding="16,12,16,12"> <StackPanel> <TextBlock x:Name="HDTImportOsTitleText" Foreground="{DynamicResource HDTBannerTextBrush}" FontSize="18" FontWeight="SemiBold" /> <TextBlock x:Name="HDTImportOsRootText" Foreground="{DynamicResource HDTBannerLabelBrush}" FontFamily="Consolas, Courier New" FontSize="11" Margin="0,3,0,0" TextTrimming="CharacterEllipsis" /> </StackPanel> </Border> <Grid Grid.Row="1" Margin="16,14,16,0"> <Grid.RowDefinitions> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="Auto" /> <RowDefinition Height="*" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="120" /> <ColumnDefinition Width="*" /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <!-- THE SOURCE COMES FIRST because everything else follows from it: the id is suggested from the folder the media sits in, and the image list is read out of the file itself. --> <TextBlock Grid.Row="0" Grid.Column="0" x:Name="HDTImportOsSourceLabel" Style="{StaticResource HDTFieldLabel}" /> <TextBox Grid.Row="0" Grid.Column="1" x:Name="HDTImportOsSourceBox" FontFamily="Consolas, Courier New" /> <Button Grid.Row="0" Grid.Column="2" x:Name="HDTImportOsSourceBrowseButton" Margin="8,0,0,10" /> <TextBlock Grid.Row="1" Grid.Column="1" Grid.ColumnSpan="2" x:Name="HDTImportOsSourceHint" Style="{StaticResource HDTFieldHint}" /> <TextBlock Grid.Row="2" Grid.Column="0" x:Name="HDTImportOsIdLabel" Style="{StaticResource HDTFieldLabel}" /> <TextBox Grid.Row="2" Grid.Column="1" Grid.ColumnSpan="2" x:Name="HDTImportOsIdBox" FontFamily="Consolas, Courier New" /> <TextBlock Grid.Row="3" Grid.Column="1" Grid.ColumnSpan="2" x:Name="HDTImportOsIdHint" Style="{StaticResource HDTFieldHint}" /> <TextBlock Grid.Row="4" Grid.Column="0" x:Name="HDTImportOsNameLabel" Style="{StaticResource HDTFieldLabel}" /> <TextBox Grid.Row="4" Grid.Column="1" Grid.ColumnSpan="2" x:Name="HDTImportOsNameBox" /> <TextBlock Grid.Row="5" Grid.Column="0" x:Name="HDTImportOsDescriptionLabel" Style="{StaticResource HDTFieldLabel}" /> <TextBox Grid.Row="5" Grid.Column="1" Grid.ColumnSpan="2" x:Name="HDTImportOsDescriptionBox" /> <!-- WHAT IS WRONG WITH THE ANSWERS, said as they are typed rather than on the last press. Test-HDTConsoleImportOperatingSystem decides it; this shows it. --> <TextBlock Grid.Row="6" Grid.ColumnSpan="3" x:Name="HDTImportOsMessageText" Foreground="{DynamicResource HDTErrorBrush}" TextWrapping="Wrap" Margin="0,4,0,0" /> </Grid> <Border Grid.Row="2" Margin="16,0,16,0" Padding="0,8,0,8"> <TextBlock x:Name="HDTImportOsCommandText" Foreground="{DynamicResource HDTCommandTextBrush}" FontFamily="Consolas, Courier New" FontSize="11" TextWrapping="Wrap" /> </Border> <Border Grid.Row="3" Background="{DynamicResource HDTFooterBrush}" Padding="16,12,16,12"> <StackPanel Orientation="Horizontal" HorizontalAlignment="Right"> <Button x:Name="HDTImportOsImportButton" MinWidth="96" IsDefault="True" /> <Button x:Name="HDTCancelButton" MinWidth="96" Margin="8,0,0,0" IsCancel="True" /> </StackPanel> </Border> </Grid> </Window> |