412 lines
26 KiB
XML
412 lines
26 KiB
XML
<UserControl x:Class="EbayListingTool.Views.NewListingView"
|
||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
||
xmlns:mah="http://metro.mahapps.com/winfx/xaml/controls"
|
||
xmlns:iconPacks="http://metro.mahapps.com/winfx/xaml/iconpacks"
|
||
Loaded="UserControl_Loaded">
|
||
|
||
<!-- Root grid hosts all three states; Visibility toggled in code-behind -->
|
||
<Grid>
|
||
<!-- ══════════════════════════════════════ STATE A: Drop Zone -->
|
||
<Grid x:Name="StateA" Visibility="Visible">
|
||
<DockPanel LastChildFill="True">
|
||
|
||
<!-- Loading panel — shown while AI runs -->
|
||
<Border x:Name="LoadingPanel" DockPanel.Dock="Top"
|
||
Visibility="Collapsed"
|
||
Margin="60,30,60,0" Padding="30,40"
|
||
Background="{DynamicResource MahApps.Brushes.Gray9}"
|
||
CornerRadius="10">
|
||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center">
|
||
<mah:ProgressRing Width="36" Height="36"
|
||
HorizontalAlignment="Center" Margin="0,0,0,16"/>
|
||
<TextBlock x:Name="LoadingStepText"
|
||
Text="Examining the photo…"
|
||
FontSize="14" FontWeight="SemiBold"
|
||
HorizontalAlignment="Center"
|
||
Foreground="{DynamicResource MahApps.Brushes.Gray1}"/>
|
||
<TextBlock Text="This usually takes 10–20 seconds"
|
||
FontSize="11" HorizontalAlignment="Center"
|
||
Foreground="{DynamicResource MahApps.Brushes.Gray5}"
|
||
Margin="0,6,0,0"/>
|
||
</StackPanel>
|
||
</Border>
|
||
|
||
<!-- Drop zone -->
|
||
<Border x:Name="DropZoneBorder" DockPanel.Dock="Top"
|
||
Margin="60,30,60,0"
|
||
AllowDrop="True"
|
||
MouseLeftButtonUp="DropZone_Click"
|
||
DragOver="DropZone_DragOver"
|
||
DragEnter="DropZone_DragEnter"
|
||
DragLeave="DropZone_DragLeave"
|
||
Drop="DropZone_Drop"
|
||
Cursor="Hand"
|
||
MinHeight="180">
|
||
<Grid>
|
||
<!-- Dashed border via Rectangle -->
|
||
<Rectangle x:Name="DropBorderRect"
|
||
StrokeThickness="2"
|
||
StrokeDashArray="6,4"
|
||
RadiusX="10" RadiusY="10"
|
||
Stroke="{DynamicResource MahApps.Brushes.Gray6}"/>
|
||
<StackPanel HorizontalAlignment="Center" VerticalAlignment="Center"
|
||
Margin="0,40">
|
||
<iconPacks:PackIconMaterial Kind="CameraOutline"
|
||
Width="52" Height="52"
|
||
HorizontalAlignment="Center"
|
||
Foreground="{DynamicResource MahApps.Brushes.Gray5}"
|
||
Margin="0,0,0,16"/>
|
||
<TextBlock Text="Drop photos here"
|
||
FontSize="18" FontWeight="SemiBold"
|
||
HorizontalAlignment="Center"
|
||
Foreground="{DynamicResource MahApps.Brushes.Gray2}"/>
|
||
<TextBlock Text="or click to browse — up to 12 photos"
|
||
FontSize="12" HorizontalAlignment="Center"
|
||
Foreground="{DynamicResource MahApps.Brushes.Gray5}"
|
||
Margin="0,6,0,0"/>
|
||
</StackPanel>
|
||
</Grid>
|
||
</Border>
|
||
|
||
<!-- Thumbnail strip -->
|
||
<ScrollViewer x:Name="ThumbScroller" DockPanel.Dock="Top"
|
||
HorizontalScrollBarVisibility="Auto"
|
||
VerticalScrollBarVisibility="Disabled"
|
||
Margin="60,12,60,0" Visibility="Collapsed">
|
||
<StackPanel x:Name="ThumbStrip" Orientation="Horizontal"/>
|
||
</ScrollViewer>
|
||
|
||
<!-- Analyse button -->
|
||
<StackPanel DockPanel.Dock="Top" HorizontalAlignment="Center" Margin="0,20,0,0">
|
||
<Button x:Name="AnalyseBtn"
|
||
Click="Analyse_Click"
|
||
IsEnabled="False"
|
||
Style="{StaticResource MahApps.Styles.Button.Square.Accent}"
|
||
Padding="28,12" FontSize="14" FontWeight="SemiBold">
|
||
<StackPanel Orientation="Horizontal">
|
||
<iconPacks:PackIconMaterial x:Name="AnalyseIcon"
|
||
Kind="MagnifyScan" Width="18" Height="18"
|
||
Margin="0,0,8,0" VerticalAlignment="Center"/>
|
||
<mah:ProgressRing x:Name="AnalyseSpinner"
|
||
Width="18" Height="18" Margin="0,0,8,0"
|
||
Visibility="Collapsed"/>
|
||
<TextBlock x:Name="AnalyseBtnText"
|
||
Text="Identify & Price with AI"
|
||
VerticalAlignment="Center"/>
|
||
</StackPanel>
|
||
</Button>
|
||
<TextBlock x:Name="PhotoCountLabel"
|
||
HorizontalAlignment="Center" Margin="0,8,0,0"
|
||
FontSize="11" Visibility="Collapsed"
|
||
Foreground="{DynamicResource MahApps.Brushes.Gray5}"/>
|
||
</StackPanel>
|
||
|
||
<Grid/> <!-- fill remaining space -->
|
||
</DockPanel>
|
||
</Grid>
|
||
|
||
<!-- ══════════════════════════════════════ STATE B: Review & Edit -->
|
||
<Grid x:Name="StateB" Visibility="Collapsed">
|
||
<DockPanel LastChildFill="True">
|
||
|
||
<!-- Footer bar — pinned to bottom via DockPanel.Dock -->
|
||
<Border DockPanel.Dock="Bottom"
|
||
Background="{DynamicResource MahApps.Brushes.Gray9}"
|
||
BorderThickness="0,1,0,0"
|
||
BorderBrush="{DynamicResource MahApps.Brushes.Gray7}"
|
||
Padding="16,8">
|
||
<Grid>
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="*"/>
|
||
<ColumnDefinition Width="Auto"/>
|
||
</Grid.ColumnDefinitions>
|
||
<Button Grid.Column="0" x:Name="StartOverBtn"
|
||
Click="StartOver_Click"
|
||
Background="Transparent" BorderThickness="0"
|
||
Foreground="{DynamicResource MahApps.Brushes.Gray5}"
|
||
Cursor="Hand" VerticalAlignment="Center">
|
||
<TextBlock FontSize="11">
|
||
<Run Text="← "/>
|
||
<Run Text="Start Over" TextDecorations="Underline"/>
|
||
</TextBlock>
|
||
</Button>
|
||
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
||
<Button x:Name="SaveDraftBtn"
|
||
Click="SaveDraft_Click"
|
||
Style="{StaticResource MahApps.Styles.Button.Square}"
|
||
Padding="16,8" Margin="0,0,8,0">
|
||
<StackPanel Orientation="Horizontal">
|
||
<iconPacks:PackIconMaterial Kind="ContentSaveOutline"
|
||
Width="14" Height="14" Margin="0,0,6,0"
|
||
VerticalAlignment="Center"/>
|
||
<TextBlock Text="Save as Draft" VerticalAlignment="Center"/>
|
||
</StackPanel>
|
||
</Button>
|
||
<Button x:Name="PostBtn"
|
||
Click="Post_Click"
|
||
Style="{StaticResource MahApps.Styles.Button.Square.Accent}"
|
||
Padding="16,8">
|
||
<StackPanel Orientation="Horizontal">
|
||
<iconPacks:PackIconMaterial x:Name="PostIcon"
|
||
Kind="CartArrowRight" Width="14" Height="14"
|
||
Margin="0,0,6,0" VerticalAlignment="Center"/>
|
||
<mah:ProgressRing x:Name="PostSpinner"
|
||
Width="14" Height="14" Margin="0,0,6,0"
|
||
Visibility="Collapsed"/>
|
||
<TextBlock Text="Post to eBay" VerticalAlignment="Center"/>
|
||
</StackPanel>
|
||
</Button>
|
||
</StackPanel>
|
||
</Grid>
|
||
</Border>
|
||
|
||
<!-- Two-column content area -->
|
||
<Grid DockPanel.Dock="Top" Margin="16,12,16,0">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="220"/>
|
||
<ColumnDefinition Width="12"/>
|
||
<ColumnDefinition Width="*"/>
|
||
</Grid.ColumnDefinitions>
|
||
|
||
<!-- LEFT: Photos panel -->
|
||
<DockPanel Grid.Column="0">
|
||
<TextBlock DockPanel.Dock="Top"
|
||
Text="PHOTOS" FontSize="10" FontWeight="SemiBold"
|
||
Foreground="{DynamicResource MahApps.Brushes.Gray5}"
|
||
Margin="0,0,0,8"/>
|
||
<StackPanel DockPanel.Dock="Bottom" Orientation="Horizontal" Margin="0,8,0,0">
|
||
<Button x:Name="AddMorePhotosBtn" Click="AddMorePhotos_Click"
|
||
Style="{StaticResource MahApps.Styles.Button.Square}"
|
||
Padding="8,4" FontSize="11">
|
||
<StackPanel Orientation="Horizontal">
|
||
<iconPacks:PackIconMaterial Kind="Plus" Width="12" Height="12"
|
||
Margin="0,0,4,0" VerticalAlignment="Center"/>
|
||
<TextBlock Text="Add more" VerticalAlignment="Center"/>
|
||
</StackPanel>
|
||
</Button>
|
||
<TextBlock x:Name="BPhotoCount"
|
||
Margin="8,0,0,0" VerticalAlignment="Center"
|
||
FontSize="11"
|
||
Foreground="{DynamicResource MahApps.Brushes.Gray5}"/>
|
||
</StackPanel>
|
||
<ScrollViewer VerticalScrollBarVisibility="Auto">
|
||
<WrapPanel x:Name="BPhotosPanel"/>
|
||
</ScrollViewer>
|
||
</DockPanel>
|
||
|
||
<!-- RIGHT: Listing fields -->
|
||
<ScrollViewer Grid.Column="2" VerticalScrollBarVisibility="Auto">
|
||
<StackPanel Margin="0,0,8,16">
|
||
<TextBlock Text="LISTING DETAILS"
|
||
FontSize="10" FontWeight="SemiBold"
|
||
Foreground="{DynamicResource MahApps.Brushes.Gray5}"
|
||
Margin="0,0,0,12"/>
|
||
|
||
<!-- Title -->
|
||
<Grid Margin="0,0,0,4">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="*"/>
|
||
<ColumnDefinition Width="Auto"/>
|
||
</Grid.ColumnDefinitions>
|
||
<TextBlock Text="Title" FontSize="11" FontWeight="SemiBold"
|
||
Foreground="{DynamicResource MahApps.Brushes.Gray3}"
|
||
VerticalAlignment="Center"/>
|
||
<Button Grid.Column="1" x:Name="AiTitleBtn" Click="AiTitle_Click"
|
||
Style="{StaticResource MahApps.Styles.Button.Square}"
|
||
Padding="6,2" ToolTip="Improve title with AI">
|
||
<StackPanel Orientation="Horizontal">
|
||
<iconPacks:PackIconMaterial x:Name="TitleAiIcon"
|
||
Kind="AutoFix" Width="12" Height="12"
|
||
Margin="0,0,4,0" VerticalAlignment="Center"/>
|
||
<mah:ProgressRing x:Name="TitleSpinner" Width="12" Height="12"
|
||
Margin="0,0,4,0" Visibility="Collapsed"/>
|
||
<TextBlock Text="AI" FontSize="10" VerticalAlignment="Center"/>
|
||
</StackPanel>
|
||
</Button>
|
||
</Grid>
|
||
<TextBox x:Name="BTitleBox" TextChanged="TitleBox_TextChanged"
|
||
MaxLength="80" Margin="0,0,0,2"/>
|
||
<Grid Margin="0,0,0,12">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="*"/>
|
||
<ColumnDefinition Width="Auto"/>
|
||
</Grid.ColumnDefinitions>
|
||
<Border Height="3" CornerRadius="1.5"
|
||
Background="{DynamicResource MahApps.Brushes.Gray8}">
|
||
<Border x:Name="BTitleBar" Height="3" CornerRadius="1.5"
|
||
HorizontalAlignment="Left" Width="0"
|
||
Background="{DynamicResource MahApps.Brushes.Accent}"/>
|
||
</Border>
|
||
<TextBlock x:Name="BTitleCount" Grid.Column="1"
|
||
Text="0 / 80" FontSize="10" Margin="6,0,0,0"
|
||
Foreground="{DynamicResource MahApps.Brushes.Gray5}"/>
|
||
</Grid>
|
||
|
||
<!-- Description -->
|
||
<Grid Margin="0,0,0,4">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="*"/>
|
||
<ColumnDefinition Width="Auto"/>
|
||
</Grid.ColumnDefinitions>
|
||
<TextBlock Text="Description" FontSize="11" FontWeight="SemiBold"
|
||
Foreground="{DynamicResource MahApps.Brushes.Gray3}"
|
||
VerticalAlignment="Center"/>
|
||
<Button Grid.Column="1" x:Name="AiDescBtn" Click="AiDesc_Click"
|
||
Style="{StaticResource MahApps.Styles.Button.Square}"
|
||
Padding="6,2" ToolTip="Write description with AI">
|
||
<StackPanel Orientation="Horizontal">
|
||
<iconPacks:PackIconMaterial x:Name="DescAiIcon"
|
||
Kind="AutoFix" Width="12" Height="12"
|
||
Margin="0,0,4,0" VerticalAlignment="Center"/>
|
||
<mah:ProgressRing x:Name="DescSpinner" Width="12" Height="12"
|
||
Margin="0,0,4,0" Visibility="Collapsed"/>
|
||
<TextBlock Text="AI" FontSize="10" VerticalAlignment="Center"/>
|
||
</StackPanel>
|
||
</Button>
|
||
</Grid>
|
||
<TextBox x:Name="BDescBox" TextChanged="DescBox_TextChanged"
|
||
AcceptsReturn="True" TextWrapping="Wrap"
|
||
Height="110" VerticalScrollBarVisibility="Auto"
|
||
Margin="0,0,0,2"/>
|
||
<Grid Margin="0,0,0,12">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="*"/>
|
||
<ColumnDefinition Width="Auto"/>
|
||
</Grid.ColumnDefinitions>
|
||
<Border Height="3" CornerRadius="1.5"
|
||
Background="{DynamicResource MahApps.Brushes.Gray8}">
|
||
<Border x:Name="BDescBar" Height="3" CornerRadius="1.5"
|
||
HorizontalAlignment="Left" Width="0"
|
||
Background="{DynamicResource MahApps.Brushes.Accent}"/>
|
||
</Border>
|
||
<TextBlock x:Name="BDescCount" Grid.Column="1"
|
||
Text="0 / 2000" FontSize="10" Margin="6,0,0,0"
|
||
Foreground="{DynamicResource MahApps.Brushes.Gray5}"/>
|
||
</Grid>
|
||
|
||
<!-- Category -->
|
||
<TextBlock Text="Category" FontSize="11" FontWeight="SemiBold"
|
||
Foreground="{DynamicResource MahApps.Brushes.Gray3}"
|
||
Margin="0,0,0,4"/>
|
||
<Grid Margin="0,0,0,2">
|
||
<TextBox x:Name="BCategoryBox"
|
||
TextChanged="CategoryBox_TextChanged"
|
||
KeyDown="CategoryBox_KeyDown"
|
||
mah:TextBoxHelper.Watermark="Type to search categories…"/>
|
||
<ListBox x:Name="BCategoryList"
|
||
Visibility="Collapsed"
|
||
SelectionChanged="CategoryList_SelectionChanged"
|
||
MaxHeight="160"
|
||
VerticalAlignment="Top"
|
||
Margin="0,32,0,0"
|
||
Panel.ZIndex="10"
|
||
Background="{DynamicResource MahApps.Brushes.Gray8}"
|
||
BorderBrush="{DynamicResource MahApps.Brushes.Gray6}"/>
|
||
</Grid>
|
||
<TextBlock x:Name="BCategoryIdLabel"
|
||
Text="(no category selected)"
|
||
FontSize="10" Margin="0,0,0,12"
|
||
Foreground="{DynamicResource MahApps.Brushes.Gray5}"/>
|
||
|
||
<!-- Condition + Format -->
|
||
<Grid Margin="0,0,0,12">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="*"/>
|
||
<ColumnDefinition Width="12"/>
|
||
<ColumnDefinition Width="*"/>
|
||
</Grid.ColumnDefinitions>
|
||
<StackPanel Grid.Column="0">
|
||
<TextBlock Text="Condition" FontSize="11" FontWeight="SemiBold"
|
||
Foreground="{DynamicResource MahApps.Brushes.Gray3}"
|
||
Margin="0,0,0,4"/>
|
||
<ComboBox x:Name="BConditionBox"
|
||
SelectionChanged="ConditionBox_SelectionChanged">
|
||
<ComboBoxItem Content="New" Tag="New"/>
|
||
<ComboBoxItem Content="Open Box" Tag="OpenBox"/>
|
||
<ComboBoxItem Content="Refurbished" Tag="Refurbished"/>
|
||
<ComboBoxItem Content="Used" Tag="Used" IsSelected="True"/>
|
||
<ComboBoxItem Content="For Parts" Tag="ForParts"/>
|
||
</ComboBox>
|
||
</StackPanel>
|
||
<StackPanel Grid.Column="2">
|
||
<TextBlock Text="Format" FontSize="11" FontWeight="SemiBold"
|
||
Foreground="{DynamicResource MahApps.Brushes.Gray3}"
|
||
Margin="0,0,0,4"/>
|
||
<ComboBox x:Name="BFormatBox">
|
||
<ComboBoxItem Content="Fixed Price" IsSelected="True"/>
|
||
<ComboBoxItem Content="Auction"/>
|
||
</ComboBox>
|
||
</StackPanel>
|
||
</Grid>
|
||
|
||
<!-- Price -->
|
||
<Grid Margin="0,0,0,4">
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="*"/>
|
||
<ColumnDefinition Width="Auto"/>
|
||
</Grid.ColumnDefinitions>
|
||
<TextBlock Text="Price" FontSize="11" FontWeight="SemiBold"
|
||
Foreground="{DynamicResource MahApps.Brushes.Gray3}"
|
||
VerticalAlignment="Center"/>
|
||
<Button Grid.Column="1" x:Name="AiPriceBtn" Click="AiPrice_Click"
|
||
Style="{StaticResource MahApps.Styles.Button.Square}"
|
||
Padding="6,2" ToolTip="Research live eBay price">
|
||
<StackPanel Orientation="Horizontal">
|
||
<iconPacks:PackIconMaterial x:Name="PriceAiIcon"
|
||
Kind="Magnify" Width="12" Height="12"
|
||
Margin="0,0,4,0" VerticalAlignment="Center"/>
|
||
<mah:ProgressRing x:Name="PriceSpinner" Width="12" Height="12"
|
||
Margin="0,0,4,0" Visibility="Collapsed"/>
|
||
<TextBlock Text="Research" FontSize="10" VerticalAlignment="Center"/>
|
||
</StackPanel>
|
||
</Button>
|
||
</Grid>
|
||
<mah:NumericUpDown x:Name="BPriceBox"
|
||
StringFormat="£{0:0.00}"
|
||
Minimum="0" Maximum="99999"
|
||
Interval="0.50"
|
||
Margin="0,0,0,4"/>
|
||
<TextBlock x:Name="BPriceHint"
|
||
FontSize="10" Margin="0,0,0,12"
|
||
Visibility="Collapsed"
|
||
Foreground="{DynamicResource MahApps.Brushes.Gray5}"/>
|
||
|
||
<!-- Postage + Postcode -->
|
||
<Grid>
|
||
<Grid.ColumnDefinitions>
|
||
<ColumnDefinition Width="*"/>
|
||
<ColumnDefinition Width="12"/>
|
||
<ColumnDefinition Width="120"/>
|
||
</Grid.ColumnDefinitions>
|
||
<StackPanel Grid.Column="0">
|
||
<TextBlock Text="Postage" FontSize="11" FontWeight="SemiBold"
|
||
Foreground="{DynamicResource MahApps.Brushes.Gray3}"
|
||
Margin="0,0,0,4"/>
|
||
<ComboBox x:Name="BPostageBox">
|
||
<ComboBoxItem Content="Royal Mail 1st Class" Tag="RoyalMailFirstClass"/>
|
||
<ComboBoxItem Content="Royal Mail 2nd Class" Tag="RoyalMailSecondClass" IsSelected="True"/>
|
||
<ComboBoxItem Content="Royal Mail Tracked 24" Tag="RoyalMailTracked24"/>
|
||
<ComboBoxItem Content="Royal Mail Tracked 48" Tag="RoyalMailTracked48"/>
|
||
<ComboBoxItem Content="Collection Only" Tag="CollectionOnly"/>
|
||
<ComboBoxItem Content="Free Postage" Tag="FreePostage"/>
|
||
</ComboBox>
|
||
</StackPanel>
|
||
<StackPanel Grid.Column="2">
|
||
<TextBlock Text="From postcode" FontSize="11" FontWeight="SemiBold"
|
||
Foreground="{DynamicResource MahApps.Brushes.Gray3}"
|
||
Margin="0,0,0,4"/>
|
||
<TextBox x:Name="BPostcodeBox"/>
|
||
</StackPanel>
|
||
</Grid>
|
||
</StackPanel>
|
||
</ScrollViewer>
|
||
</Grid>
|
||
</DockPanel>
|
||
</Grid>
|
||
|
||
<!-- ══════════════════════════════════════ STATE C: Success (stub for now) -->
|
||
<Grid x:Name="StateC" Visibility="Collapsed"/>
|
||
</Grid>
|
||
</UserControl>
|