116 lines
7.0 KiB
XML
116 lines
7.0 KiB
XML
<UserControl x:Class="DesktopBot.Views.BalanceView"
|
|
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
|
|
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
|
|
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
|
|
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
|
|
mc:Ignorable="d">
|
|
<UserControl.Resources>
|
|
<Style x:Key="ColHeader" TargetType="TextBlock">
|
|
<Setter Property="Foreground" Value="{StaticResource TextSecondaryBrush}"/>
|
|
<Setter Property="FontFamily" Value="Segoe UI"/>
|
|
<Setter Property="FontSize" Value="11"/>
|
|
<Setter Property="FontWeight" Value="SemiBold"/>
|
|
<Setter Property="Padding" Value="10,8"/>
|
|
</Style>
|
|
<Style x:Key="GridCell" TargetType="TextBlock">
|
|
<Setter Property="Foreground" Value="{StaticResource TextPrimaryBrush}"/>
|
|
<Setter Property="FontFamily" Value="Segoe UI"/>
|
|
<Setter Property="FontSize" Value="12"/>
|
|
<Setter Property="Padding" Value="10,6"/>
|
|
<Setter Property="VerticalAlignment" Value="Center"/>
|
|
</Style>
|
|
</UserControl.Resources>
|
|
<Grid Background="{StaticResource BackgroundDarkBrush}">
|
|
<Grid.RowDefinitions>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="Auto"/>
|
|
<RowDefinition Height="*"/>
|
|
</Grid.RowDefinitions>
|
|
<!-- Header -->
|
|
<Grid Grid.Row="0" Margin="24,20,24,0">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="Auto"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Grid.Column="0" Text="Balance" Style="{StaticResource SectionTitle}" Margin="0"/>
|
|
<StackPanel Grid.Column="1" Orientation="Horizontal">
|
|
<TextBlock Text="Caricamento..." Foreground="{StaticResource TextSecondaryBrush}"
|
|
FontFamily="Segoe UI" FontSize="12" VerticalAlignment="Center" Margin="0,0,12,0"
|
|
Visibility="{Binding IsLoading, Converter={StaticResource BoolToVisConverter}}"/>
|
|
<Button Content="↻ Aggiorna" Command="{Binding RefreshCommand}"
|
|
Style="{StaticResource OutlineButton}" Padding="14,7"/>
|
|
</StackPanel>
|
|
</Grid>
|
|
<!-- Sottotitolo colonne -->
|
|
<TextBlock Grid.Row="1" Margin="24,8,24,0"
|
|
Text="Panoramica completa del bilancio del conto Alpaca"
|
|
Style="{StaticResource LabelSecondary}"/>
|
|
<!-- Errore -->
|
|
<Border Grid.Row="2" Margin="24,10,24,0"
|
|
Background="#2A1515" BorderBrush="{StaticResource AccentRedBrush}"
|
|
BorderThickness="1" CornerRadius="6" Padding="14,8"
|
|
Visibility="{Binding HasError, Converter={StaticResource BoolToVisConverter}}">
|
|
<TextBlock Text="{Binding ErrorMessage}" Foreground="{StaticResource AccentRedBrush}"
|
|
FontFamily="Segoe UI" FontSize="12"/>
|
|
</Border>
|
|
<!-- Intestazione colonne -->
|
|
<Grid Grid.Row="3" Margin="24,14,24,0"
|
|
Background="{StaticResource BackgroundPanelBrush}">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="200"/>
|
|
<ColumnDefinition Width="200"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Grid.Column="0" Text="Voce" Style="{StaticResource ColHeader}"/>
|
|
<TextBlock Grid.Column="1" Text="Ultima Chiusura" Style="{StaticResource ColHeader}" HorizontalAlignment="Right"/>
|
|
<TextBlock Grid.Column="2" Text="Corrente" Style="{StaticResource ColHeader}" HorizontalAlignment="Right" Padding="10,8,20,8"/>
|
|
</Grid>
|
|
<!-- Righe -->
|
|
<ScrollViewer Grid.Row="4" Margin="24,0,24,20" VerticalScrollBarVisibility="Auto">
|
|
<ItemsControl ItemsSource="{Binding BalanceRows}">
|
|
<ItemsControl.ItemTemplate>
|
|
<DataTemplate>
|
|
<Border BorderBrush="{StaticResource BorderBrush}" BorderThickness="0,0,0,1">
|
|
<Grid>
|
|
<!-- Sezione -->
|
|
<TextBlock Text="{Binding Label}"
|
|
Foreground="{StaticResource TextSecondaryBrush}"
|
|
FontFamily="Segoe UI" FontSize="11" FontWeight="Bold"
|
|
Padding="10,10,10,4" Background="{StaticResource BackgroundDarkBrush}"
|
|
Visibility="{Binding IsSection, Converter={StaticResource BoolToVisConverter}}"/>
|
|
<!-- Riga dati -->
|
|
<Grid Visibility="{Binding IsSection, Converter={StaticResource InverseBoolConverter}}">
|
|
<Grid.ColumnDefinitions>
|
|
<ColumnDefinition Width="*"/>
|
|
<ColumnDefinition Width="200"/>
|
|
<ColumnDefinition Width="200"/>
|
|
</Grid.ColumnDefinitions>
|
|
<TextBlock Grid.Column="0" Text="{Binding Label}" Padding="24,6,10,6">
|
|
<TextBlock.Style>
|
|
<Style TargetType="TextBlock" BasedOn="{StaticResource GridCell}">
|
|
<Style.Triggers>
|
|
<DataTrigger Binding="{Binding IsBold}" Value="True">
|
|
<Setter Property="FontWeight" Value="Bold"/>
|
|
<Setter Property="Foreground" Value="{StaticResource AccentGreenBrush}"/>
|
|
</DataTrigger>
|
|
</Style.Triggers>
|
|
</Style>
|
|
</TextBlock.Style>
|
|
</TextBlock>
|
|
<TextBlock Grid.Column="1" Text="{Binding LastClose}"
|
|
Style="{StaticResource GridCell}" HorizontalAlignment="Right"
|
|
Foreground="{StaticResource TextSecondaryBrush}"/>
|
|
<TextBlock Grid.Column="2" Text="{Binding Current}"
|
|
Style="{StaticResource GridCell}" HorizontalAlignment="Right" Padding="10,6,20,6"/>
|
|
</Grid>
|
|
</Grid>
|
|
</Border>
|
|
</DataTemplate>
|
|
</ItemsControl.ItemTemplate>
|
|
</ItemsControl>
|
|
</ScrollViewer>
|
|
</Grid>
|
|
</UserControl>
|