feat: add aspects panel and shipping cost field to SingleItemView XAML
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -204,6 +204,55 @@
|
||||
</ListBox.ItemTemplate>
|
||||
</ListBox>
|
||||
|
||||
<!-- Item Specifics (Aspects) panel — revealed after category is selected -->
|
||||
<Border x:Name="AspectsPanel" Visibility="Collapsed"
|
||||
CornerRadius="4" Margin="0,10,0,0" Padding="12,10"
|
||||
BorderBrush="{DynamicResource MahApps.Brushes.Gray7}" BorderThickness="1">
|
||||
<StackPanel>
|
||||
<Grid Margin="0,0,0,8">
|
||||
<Grid.ColumnDefinitions>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<mah:ProgressRing x:Name="AspectsSpinner" Width="14" Height="14"
|
||||
Margin="0,0,6,0" VerticalAlignment="Center"
|
||||
Visibility="Collapsed"/>
|
||||
<TextBlock Text="Item Specifics" FontWeight="SemiBold" FontSize="12"
|
||||
VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource MahApps.Brushes.Gray2}"/>
|
||||
<TextBlock x:Name="AspectsRequiredNote"
|
||||
Text=" (required fields marked *)"
|
||||
FontSize="11" VerticalAlignment="Center"
|
||||
Foreground="{DynamicResource MahApps.Brushes.Gray5}"
|
||||
Visibility="Collapsed"/>
|
||||
</StackPanel>
|
||||
<Button Grid.Column="1" x:Name="AiAspectsBtn"
|
||||
Style="{StaticResource AiButton}"
|
||||
Height="26" Padding="10,0" FontSize="11"
|
||||
Click="AiAspects_Click"
|
||||
ToolTip="Let AI suggest values from your title and description">
|
||||
<StackPanel Orientation="Horizontal">
|
||||
<mah:ProgressRing x:Name="AspectsAiSpinner" Width="11" Height="11"
|
||||
Margin="0,0,4,0" Foreground="White"
|
||||
Visibility="Collapsed"/>
|
||||
<iconPacks:PackIconMaterial x:Name="AspectsAiIcon" Kind="AutoFix"
|
||||
Width="11" Height="11" Margin="0,0,4,0"
|
||||
VerticalAlignment="Center"/>
|
||||
<TextBlock Text="AI Suggest" VerticalAlignment="Center"/>
|
||||
</StackPanel>
|
||||
</Button>
|
||||
</Grid>
|
||||
<ItemsControl x:Name="AspectsItemsControl">
|
||||
<ItemsControl.ItemsPanel>
|
||||
<ItemsPanelTemplate>
|
||||
<WrapPanel Orientation="Horizontal"/>
|
||||
</ItemsPanelTemplate>
|
||||
</ItemsControl.ItemsPanel>
|
||||
</ItemsControl>
|
||||
</StackPanel>
|
||||
</Border>
|
||||
|
||||
<!-- Condition + Format -->
|
||||
<Grid Margin="0,10,0,0">
|
||||
<Grid.ColumnDefinitions>
|
||||
@@ -311,6 +360,8 @@
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="12"/>
|
||||
<ColumnDefinition Width="*"/>
|
||||
<ColumnDefinition Width="16"/>
|
||||
<ColumnDefinition Width="Auto"/>
|
||||
</Grid.ColumnDefinitions>
|
||||
|
||||
<!-- Price with inline AI button -->
|
||||
@@ -352,7 +403,7 @@
|
||||
|
||||
<StackPanel Grid.Column="4">
|
||||
<TextBlock Style="{StaticResource FieldLabel}" Text="Postage"/>
|
||||
<ComboBox x:Name="PostageBox">
|
||||
<ComboBox x:Name="PostageBox" SelectionChanged="PostageBox_SelectionChanged">
|
||||
<ComboBoxItem Content="Royal Mail 1st Class (~£1.55)" IsSelected="True"/>
|
||||
<ComboBoxItem Content="Royal Mail 2nd Class (~£1.20)"/>
|
||||
<ComboBoxItem Content="Royal Mail Tracked 24 (~£2.90)"/>
|
||||
@@ -361,6 +412,14 @@
|
||||
<ComboBoxItem Content="Collection Only"/>
|
||||
</ComboBox>
|
||||
</StackPanel>
|
||||
|
||||
<StackPanel Grid.Column="6">
|
||||
<TextBlock Style="{StaticResource FieldLabel}" Text="Shipping Cost (£)"/>
|
||||
<mah:NumericUpDown x:Name="ShippingCostBox"
|
||||
Minimum="0" Maximum="99" StringFormat="F2"
|
||||
Interval="0.50" Value="0"
|
||||
Width="110" HorizontalAlignment="Left"/>
|
||||
</StackPanel>
|
||||
</Grid>
|
||||
|
||||
<!-- Postcode — narrower input, left-aligned -->
|
||||
|
||||
@@ -691,4 +691,15 @@ public partial class SingleItemView : UserControl
|
||||
=> MessageBox.Show(message, title, MessageBoxButton.OK, MessageBoxImage.Warning);
|
||||
|
||||
private MainWindow? GetWindow() => Window.GetWindow(this) as MainWindow;
|
||||
|
||||
private void PostageBox_SelectionChanged(object sender, System.Windows.Controls.SelectionChangedEventArgs e)
|
||||
{
|
||||
// TODO: Task 5 — update ShippingCostBox default based on selected postage option
|
||||
}
|
||||
|
||||
private async void AiAspects_Click(object sender, RoutedEventArgs e)
|
||||
{
|
||||
// TODO: Task 5 — call EbayAspectsService.SuggestAspectsAsync and populate AspectsItemsControl
|
||||
await Task.CompletedTask;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user