UI/Console/HDTNewMedia.xaml
|
<!--
MDT'S Advanced Configuration \ Media node, the New action - one page: id, name, which selection profile projects onto the disc, and where the ISO goes. New-HDTMedia (07-01) already writes the document and refuses everything worth refusing; this window asks its four questions and shows the exact line Create is about to run. Description IS DELIBERATELY NOT HERE. New-HDTMedia -Description stays '' from this dialog - an administrator who wants one still has Set-HDTMedia, and a fifth optional field is scope this plan was not asked for. THE PROFILE IS CHOSEN, NEVER TYPED - a ComboBox, the way HDTBootImage.xaml's own profile picker is one and for the same reason: a typed name that is wrong builds a media item with no content on the disc. OUTPUT GETS A BROWSE BUTTON, ID AND NAME DO NOT - an id and a name are typed; an ISO's destination is a path on disk, the way every other path field in this console pairs a TextBox with a Browse button. Left empty, New-HDTMedia fills in Media\<id>\HDT_<id>.iso itself. NO x:Class AND NO CODE-BEHIND, as every other window here. Handlers are attached in PowerShell, by name. --> <Window xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" Title="New Media" Width="620" Height="460" WindowStartupLocation="CenterOwner" ResizeMode="NoResize" ShowInTaskbar="False" Background="{DynamicResource HDTWindowBrush}" FontFamily="Segoe UI" FontSize="12"> <Window.Resources> <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="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="ComboBox"> <!-- AND IT MUST NOT LOOK READ-ONLY. WPF's default ComboBox template paints its own grey chrome and ignores Background, so a dropdown beside white boxes reads as a disabled one. IsEditable puts a real text box in the closed control, which takes the Background; IsReadOnly keeps it from being typed into. --> <Setter Property="IsEditable" Value="True" /> <Setter Property="IsReadOnly" Value="True" /> <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="Margin" Value="0,0,0,10" /> </Style> <!-- THE ? THE EDITOR'S PAGES USE. A Border rather than a bare glyph because WPF raises a tooltip only over what is painted. --> <Style TargetType="Border" x:Key="HDTHelpDot"> <Setter Property="Background" Value="Transparent" /> <Setter Property="Width" Value="22" /> <Setter Property="Height" Value="22" /> <Setter Property="CornerRadius" Value="11" /> <Setter Property="BorderBrush" Value="{DynamicResource HDTBorderBrush}" /> <Setter Property="BorderThickness" Value="1" /> <Setter Property="HorizontalAlignment" Value="Right" /> <Setter Property="VerticalAlignment" Value="Center" /> <Setter Property="Cursor" Value="Help" /> <Setter Property="Margin" Value="0,0,0,10" /> <Setter Property="ToolTipService.ShowDuration" Value="60000" /> <Setter Property="ToolTipService.InitialShowDelay" Value="200" /> </Style> <Style TargetType="TextBlock" x:Key="HDTHelpGlyph"> <Setter Property="Text" Value="?" /> <Setter Property="Foreground" Value="{DynamicResource HDTLabelBrush}" /> <Setter Property="FontSize" Value="12" /> <Setter Property="FontWeight" Value="Bold" /> <Setter Property="HorizontalAlignment" Value="Center" /> <Setter Property="VerticalAlignment" Value="Center" /> </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="HDTNewMediaTitleText" Foreground="{DynamicResource HDTBannerTextBrush}" FontSize="18" FontWeight="SemiBold" /> <TextBlock x:Name="HDTNewMediaRootText" 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="*" /> </Grid.RowDefinitions> <Grid.ColumnDefinitions> <ColumnDefinition Width="150" /> <ColumnDefinition Width="*" /> <ColumnDefinition Width="30" /> </Grid.ColumnDefinitions> <TextBlock Grid.Row="0" Grid.Column="0" x:Name="HDTNewMediaIdLabel" Style="{StaticResource HDTFieldLabel}" /> <TextBox Grid.Row="0" Grid.Column="1" x:Name="HDTNewMediaIdBox" FontFamily="Consolas, Courier New" /> <Border Grid.Row="0" Grid.Column="2" Style="{StaticResource HDTHelpDot}"> <Border.ToolTip> <ToolTip MaxWidth="380"> <TextBlock TextWrapping="Wrap" x:Name="HDTNewMediaIdHint" /> </ToolTip> </Border.ToolTip> <TextBlock Style="{StaticResource HDTHelpGlyph}" /> </Border> <TextBlock Grid.Row="1" Grid.Column="0" x:Name="HDTNewMediaNameLabel" Style="{StaticResource HDTFieldLabel}" /> <TextBox Grid.Row="1" Grid.Column="1" x:Name="HDTNewMediaNameBox" /> <Border Grid.Row="1" Grid.Column="2" Style="{StaticResource HDTHelpDot}"> <Border.ToolTip> <ToolTip MaxWidth="380"> <TextBlock TextWrapping="Wrap" x:Name="HDTNewMediaNameHint" /> </ToolTip> </Border.ToolTip> <TextBlock Style="{StaticResource HDTHelpGlyph}" /> </Border> <TextBlock Grid.Row="2" Grid.Column="0" x:Name="HDTNewMediaProfileLabel" Style="{StaticResource HDTFieldLabel}" /> <ComboBox Grid.Row="2" Grid.Column="1" x:Name="HDTNewMediaProfileBox" DisplayMemberPath="Name" SelectedValuePath="Id" /> <Border Grid.Row="2" Grid.Column="2" Style="{StaticResource HDTHelpDot}"> <Border.ToolTip> <ToolTip MaxWidth="380"> <TextBlock TextWrapping="Wrap" x:Name="HDTNewMediaProfileHint" /> </ToolTip> </Border.ToolTip> <TextBlock Style="{StaticResource HDTHelpGlyph}" /> </Border> <TextBlock Grid.Row="3" Grid.Column="0" x:Name="HDTNewMediaOutputLabel" Style="{StaticResource HDTFieldLabel}" /> <Grid Grid.Row="3" Grid.Column="1"> <Grid.ColumnDefinitions> <ColumnDefinition Width="*" /> <ColumnDefinition Width="Auto" /> </Grid.ColumnDefinitions> <TextBox Grid.Column="0" x:Name="HDTNewMediaOutputBox" FontFamily="Consolas, Courier New" Margin="0,0,8,10" /> <Button Grid.Column="1" x:Name="HDTNewMediaOutputBrowseButton" MinWidth="80" Margin="0,0,0,10" /> </Grid> <Border Grid.Row="3" Grid.Column="2" Style="{StaticResource HDTHelpDot}"> <Border.ToolTip> <ToolTip MaxWidth="380"> <TextBlock TextWrapping="Wrap" x:Name="HDTNewMediaOutputHint" /> </ToolTip> </Border.ToolTip> <TextBlock Style="{StaticResource HDTHelpGlyph}" /> </Border> <!-- WHAT IS WRONG WITH THE ANSWERS, said as they are typed rather than on the last press. Test-HDTConsoleNewMedia decides it; this shows it. --> <TextBlock Grid.Row="4" Grid.ColumnSpan="3" x:Name="HDTNewMediaMessageText" 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="HDTNewMediaCommandText" 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="HDTNewMediaCreateButton" MinWidth="96" IsDefault="True" /> <Button x:Name="HDTCancelButton" MinWidth="96" Margin="8,0,0,0" IsCancel="True" /> </StackPanel> </Border> </Grid> </Window> |