Aggiunta scheda "Storia Puntate" con aggiornamento live
Introdotta una nuova scheda "Storia Puntate" nel pannello dell'asta selezionata, che mostra la cronologia delle ultime puntate in tempo reale. La scheda utilizza un `TabControl` con due `TabItem`: uno per gli utenti e uno per la storia delle puntate. - Creata la classe `BidHistoryEntry` per rappresentare una singola puntata, con proprietà come `Price`, `BidType`, `Timestamp`, e calcoli formattati. - Aggiunte proprietà `RecentBids` in `AuctionInfo` e `RecentBidsHistory` in `AuctionState` per gestire i dati della cronologia. - Modificato il parsing API in `BidooApiClient` per includere la cronologia delle puntate. - Aggiornato il monitor delle aste (`AuctionMonitor.cs`) per sincronizzare i dati della cronologia con il backend. - Aggiunta la proprietà `BidHistoryEntries` in `AuctionViewModel` per il binding della griglia. - Modificata la UI (`AuctionMonitorControl.xaml`) per includere la nuova scheda e personalizzare gli stili. - Aggiornata la logica di aggiornamento UI in `MainWindow.xaml.cs` per gestire i dati della cronologia. - Documentata la funzionalità in `FEATURE_BID_HISTORY_TAB.md`. - Aggiunto uno screenshot (`Screenshot 2025-11-25 113552.png`). Questa funzionalità migliora la trasparenza e fornisce agli utenti informazioni dettagliate sulle attività recenti, aiutandoli a prendere decisioni strategiche durante le aste.
This commit is contained in:
@@ -631,63 +631,236 @@
|
||||
Background="#3E3E42"
|
||||
ResizeBehavior="PreviousAndNext"/>
|
||||
|
||||
<!-- BOTTOM CENTER: Bidders List (Utenti) -->
|
||||
<!-- BOTTOM CENTER: Tab Control (Utenti + Storia Puntate) -->
|
||||
<Border Grid.Column="2" Style="{StaticResource CardBorder}">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
<TabControl Background="#252526" BorderThickness="0">
|
||||
<TabControl.Resources>
|
||||
<!-- Tab Header Style -->
|
||||
<Style TargetType="TabItem">
|
||||
<Setter Property="Template">
|
||||
<Setter.Value>
|
||||
<ControlTemplate TargetType="TabItem">
|
||||
<Border Name="Border"
|
||||
Background="#2D2D30"
|
||||
BorderBrush="#3E3E42"
|
||||
BorderThickness="0,0,1,0"
|
||||
Padding="15,8">
|
||||
<ContentPresenter x:Name="ContentSite"
|
||||
VerticalAlignment="Center"
|
||||
HorizontalAlignment="Center"
|
||||
ContentSource="Header"/>
|
||||
</Border>
|
||||
<ControlTemplate.Triggers>
|
||||
<Trigger Property="IsSelected" Value="True">
|
||||
<Setter TargetName="Border" Property="Background" Value="#094771"/>
|
||||
</Trigger>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter TargetName="Border" Property="Background" Value="#3E3E42"/>
|
||||
</Trigger>
|
||||
</ControlTemplate.Triggers>
|
||||
</ControlTemplate>
|
||||
</Setter.Value>
|
||||
</Setter>
|
||||
<Setter Property="Foreground" Value="#CCCCCC"/>
|
||||
<Setter Property="FontSize" Value="12"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
</Style>
|
||||
</TabControl.Resources>
|
||||
|
||||
<!-- Tab 1: Utenti -->
|
||||
<TabItem Header="Utenti">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
<RowDefinition Height="Auto"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Header -->
|
||||
<Border Grid.Row="0" Background="#2D2D30" Padding="10,8" CornerRadius="4,4,0,0">
|
||||
<TextBlock x:Name="SelectedAuctionBiddersCount"
|
||||
Text="Utenti: 0"
|
||||
Foreground="#00D800"
|
||||
FontSize="13"
|
||||
FontWeight="Bold"/>
|
||||
</Border>
|
||||
<!-- Header -->
|
||||
<Border Grid.Row="0" Background="#2D2D30" Padding="10,8">
|
||||
<TextBlock x:Name="SelectedAuctionBiddersCount"
|
||||
Text="Utenti: 0"
|
||||
Foreground="#00D800"
|
||||
FontSize="13"
|
||||
FontWeight="Bold"/>
|
||||
</Border>
|
||||
|
||||
<!-- Bidders Grid -->
|
||||
<DataGrid Grid.Row="1"
|
||||
x:Name="SelectedAuctionBiddersGrid"
|
||||
AutoGenerateColumns="False"
|
||||
IsReadOnly="True"
|
||||
Background="#1E1E1E"
|
||||
Foreground="#CCCCCC"
|
||||
RowBackground="#1E1E1E"
|
||||
AlternatingRowBackground="#252526"
|
||||
GridLinesVisibility="None"
|
||||
HeadersVisibility="Column"
|
||||
BorderThickness="0"
|
||||
FontSize="11">
|
||||
<DataGrid.ColumnHeaderStyle>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<Setter Property="Background" Value="#2D2D30"/>
|
||||
<Setter Property="Foreground" Value="#CCCCCC"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<Setter Property="Padding" Value="8,5"/>
|
||||
<Setter Property="FontSize" Value="11"/>
|
||||
</Style>
|
||||
</DataGrid.ColumnHeaderStyle>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Utente" Binding="{Binding Username}" Width="*"/>
|
||||
<DataGridTextColumn Header="Punt." Binding="{Binding BidCount}" Width="50"/>
|
||||
<DataGridTextColumn Header="Ultima" Binding="{Binding LastBidTimeDisplay}" Width="70"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
<!-- Bidders Grid -->
|
||||
<DataGrid Grid.Row="1"
|
||||
x:Name="SelectedAuctionBiddersGrid"
|
||||
AutoGenerateColumns="False"
|
||||
IsReadOnly="True"
|
||||
Background="#1E1E1E"
|
||||
Foreground="#CCCCCC"
|
||||
RowBackground="#1E1E1E"
|
||||
AlternatingRowBackground="#252526"
|
||||
GridLinesVisibility="None"
|
||||
HeadersVisibility="Column"
|
||||
BorderThickness="0"
|
||||
FontSize="11">
|
||||
<DataGrid.ColumnHeaderStyle>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<Setter Property="Background" Value="#2D2D30"/>
|
||||
<Setter Property="Foreground" Value="#CCCCCC"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<Setter Property="Padding" Value="8,5"/>
|
||||
<Setter Property="FontSize" Value="11"/>
|
||||
</Style>
|
||||
</DataGrid.ColumnHeaderStyle>
|
||||
<DataGrid.Columns>
|
||||
<DataGridTextColumn Header="Utente" Binding="{Binding Username}" Width="*"/>
|
||||
<DataGridTextColumn Header="Punt." Binding="{Binding BidCount}" Width="50"/>
|
||||
<DataGridTextColumn Header="Ultima" Binding="{Binding LastBidTimeDisplay}" Width="70"/>
|
||||
</DataGrid.Columns>
|
||||
</DataGrid>
|
||||
|
||||
<!-- Footer Button -->
|
||||
<Button Grid.Row="2"
|
||||
x:Name="ClearBiddersButton"
|
||||
Content="Pulisci"
|
||||
Background="#3E3E42"
|
||||
Style="{StaticResource SmallRoundedButton}"
|
||||
HorizontalAlignment="Stretch"
|
||||
Margin="5"
|
||||
Click="ClearBiddersButton_Click"/>
|
||||
</Grid>
|
||||
<!-- Footer Button -->
|
||||
<Button Grid.Row="2"
|
||||
x:Name="ClearBiddersButton"
|
||||
Content="Pulisci"
|
||||
Background="#3E3E42"
|
||||
Style="{StaticResource SmallRoundedButton}"
|
||||
HorizontalAlignment="Stretch"
|
||||
Margin="5"
|
||||
Click="ClearBiddersButton_Click"/>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
|
||||
<!-- Tab 2: Storia Puntate -->
|
||||
<TabItem Header="Storia Puntate">
|
||||
<Grid>
|
||||
<Grid.RowDefinitions>
|
||||
<RowDefinition Height="Auto"/>
|
||||
<RowDefinition Height="*"/>
|
||||
</Grid.RowDefinitions>
|
||||
|
||||
<!-- Header -->
|
||||
<Border Grid.Row="0" Background="#2D2D30" Padding="10,8">
|
||||
<TextBlock x:Name="BidHistoryCount"
|
||||
Text="Ultime puntate: 0"
|
||||
Foreground="#00D800"
|
||||
FontSize="13"
|
||||
FontWeight="Bold"/>
|
||||
</Border>
|
||||
|
||||
<!-- Storia Puntate Grid -->
|
||||
<DataGrid Grid.Row="1"
|
||||
x:Name="BidHistoryGrid"
|
||||
ItemsSource="{Binding ElementName=MultiAuctionsGrid, Path=SelectedItem.BidHistoryEntries}"
|
||||
AutoGenerateColumns="False"
|
||||
IsReadOnly="True"
|
||||
CanUserAddRows="False"
|
||||
CanUserDeleteRows="False"
|
||||
CanUserResizeRows="False"
|
||||
HeadersVisibility="Column"
|
||||
GridLinesVisibility="Horizontal"
|
||||
HorizontalGridLinesBrush="#3E3E42"
|
||||
Background="#1E1E1E"
|
||||
Foreground="#CCCCCC"
|
||||
BorderThickness="0"
|
||||
RowHeight="28">
|
||||
|
||||
<DataGrid.Columns>
|
||||
<!-- Colonna Prezzo -->
|
||||
<DataGridTextColumn Header="PREZZO"
|
||||
Binding="{Binding PriceFormatted}"
|
||||
Width="70">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="#00D800"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="FontSize" Value="11"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
|
||||
<!-- Colonna Modalita' -->
|
||||
<DataGridTextColumn Header="TIPO"
|
||||
Binding="{Binding BidType}"
|
||||
Width="65">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="FontSize" Value="10"/>
|
||||
<Setter Property="Foreground" Value="#CCCCCC"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding BidType}" Value="Auto">
|
||||
<Setter Property="Foreground" Value="#FFC107"/>
|
||||
</DataTrigger>
|
||||
<DataTrigger Binding="{Binding BidType}" Value="Manuale">
|
||||
<Setter Property="Foreground" Value="#03A9F4"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
|
||||
<!-- Colonna Orario -->
|
||||
<DataGridTextColumn Header="ORARIO"
|
||||
Binding="{Binding TimeFormatted}"
|
||||
Width="70">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="#9E9E9E"/>
|
||||
<Setter Property="HorizontalAlignment" Value="Center"/>
|
||||
<Setter Property="FontSize" Value="10"/>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
|
||||
<!-- Colonna Utente -->
|
||||
<DataGridTextColumn Header="UTENTE"
|
||||
Binding="{Binding Username}"
|
||||
Width="*">
|
||||
<DataGridTextColumn.ElementStyle>
|
||||
<Style TargetType="TextBlock">
|
||||
<Setter Property="Foreground" Value="#CCCCCC"/>
|
||||
<Setter Property="Margin" Value="8,0,0,0"/>
|
||||
<Setter Property="FontSize" Value="11"/>
|
||||
<Style.Triggers>
|
||||
<DataTrigger Binding="{Binding IsMyBid}" Value="True">
|
||||
<Setter Property="Foreground" Value="#00D800"/>
|
||||
<Setter Property="FontWeight" Value="Bold"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGridTextColumn.ElementStyle>
|
||||
</DataGridTextColumn>
|
||||
</DataGrid.Columns>
|
||||
|
||||
<!-- Stili righe -->
|
||||
<DataGrid.RowStyle>
|
||||
<Style TargetType="DataGridRow">
|
||||
<Setter Property="Background" Value="#1E1E1E"/>
|
||||
<Style.Triggers>
|
||||
<Trigger Property="IsMouseOver" Value="True">
|
||||
<Setter Property="Background" Value="#3E3E42"/>
|
||||
</Trigger>
|
||||
<DataTrigger Binding="{Binding IsMyBid}" Value="True">
|
||||
<Setter Property="Background" Value="#1A4D1A"/>
|
||||
</DataTrigger>
|
||||
</Style.Triggers>
|
||||
</Style>
|
||||
</DataGrid.RowStyle>
|
||||
|
||||
<!-- Stile header -->
|
||||
<DataGrid.ColumnHeaderStyle>
|
||||
<Style TargetType="DataGridColumnHeader">
|
||||
<Setter Property="Background" Value="#252526"/>
|
||||
<Setter Property="Foreground" Value="#CCCCCC"/>
|
||||
<Setter Property="FontWeight" Value="SemiBold"/>
|
||||
<Setter Property="FontSize" Value="10"/>
|
||||
<Setter Property="Padding" Value="8,6"/>
|
||||
<Setter Property="BorderThickness" Value="0,0,1,1"/>
|
||||
<Setter Property="BorderBrush" Value="#3E3E42"/>
|
||||
<Setter Property="HorizontalContentAlignment" Value="Center"/>
|
||||
</Style>
|
||||
</DataGrid.ColumnHeaderStyle>
|
||||
</DataGrid>
|
||||
</Grid>
|
||||
</TabItem>
|
||||
</TabControl>
|
||||
</Border>
|
||||
|
||||
<!-- Vertical Splitter 2 -->
|
||||
|
||||
Reference in New Issue
Block a user