agrobot_base/AgroBase/OperationControl/Views/Operacao/Monitoramento/HistoricoView.xaml

382 lines
21 KiB
XML

<UserControl x:Class="OperationControl.Views.Operacao.Monitoramento.HistoricoView"
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"
xmlns:local="clr-namespace:OperationControl.Views.Operacao.Monitoramento"
mc:Ignorable="d"
d:DesignHeight="900"
d:DesignWidth="1600">
<UserControl.Resources>
<!-- Campo base escuro -->
<Style x:Key="DarkInputTextBoxStyle" TargetType="TextBox">
<Setter Property="Height" Value="36"/>
<Setter Property="Padding" Value="10,6"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Background" Value="#111315"/>
<Setter Property="BorderBrush" Value="#323842"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="CaretBrush" Value="White"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="VerticalContentAlignment" Value="Center"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="TextBox">
<Border x:Name="Bd"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="10">
<ScrollViewer x:Name="PART_ContentHost"
Margin="0"
VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsKeyboardFocused" Value="True">
<Setter TargetName="Bd" Property="BorderBrush" Value="#4C89FF"/>
<Setter TargetName="Bd" Property="Background" Value="#14181D"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="BorderBrush" Value="#46505C"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="Bd" Property="Opacity" Value="0.65"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
<!-- ComboBox escuro -->
<Style x:Key="DarkComboBoxStyle" TargetType="ComboBox">
<Setter Property="Height" Value="36"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Background" Value="#111315"/>
<Setter Property="BorderBrush" Value="#323842"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Padding" Value="10,6"/>
<Setter Property="SnapsToDevicePixels" Value="True"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="ScrollViewer.CanContentScroll" Value="True"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBox">
<Grid>
<Border x:Name="Bd"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="10"/>
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="36"/>
</Grid.ColumnDefinitions>
<!-- texto selecionado -->
<ContentPresenter Grid.Column="0"
Margin="12,0,8,0"
VerticalAlignment="Center"
HorizontalAlignment="Left"
RecognizesAccessKey="True"
Content="{TemplateBinding SelectionBoxItem}"
ContentTemplate="{TemplateBinding SelectionBoxItemTemplate}"/>
<!-- seta -->
<Border Grid.Column="1"
Background="Transparent">
<Path Width="10"
Height="6"
Stretch="Fill"
Fill="#C8D0DA"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Data="M 0 0 L 10 0 L 5 6 Z"/>
</Border>
<!-- área clicável -->
<ToggleButton Grid.ColumnSpan="2"
Background="Transparent"
BorderThickness="0"
Focusable="False"
ClickMode="Press"
IsChecked="{Binding IsDropDownOpen, RelativeSource={RelativeSource TemplatedParent}, Mode=TwoWay}">
<ToggleButton.Template>
<ControlTemplate TargetType="ToggleButton">
<Border Background="Transparent"/>
</ControlTemplate>
</ToggleButton.Template>
</ToggleButton>
</Grid>
<Popup x:Name="Popup"
Placement="Bottom"
AllowsTransparency="True"
Focusable="False"
StaysOpen="False"
IsOpen="{TemplateBinding IsDropDownOpen}"
PopupAnimation="Fade">
<Border Margin="0,4,0,0"
Background="#1A1D21"
BorderBrush="#323842"
BorderThickness="1"
CornerRadius="10"
MinWidth="{Binding ActualWidth, RelativeSource={RelativeSource TemplatedParent}}">
<ScrollViewer MaxHeight="320"
CanContentScroll="True">
<ItemsPresenter KeyboardNavigation.DirectionalNavigation="Contained"/>
</ScrollViewer>
</Border>
</Popup>
</Grid>
<ControlTemplate.Triggers>
<Trigger Property="IsKeyboardFocusWithin" Value="True">
<Setter TargetName="Bd" Property="BorderBrush" Value="#4C89FF"/>
<Setter TargetName="Bd" Property="Background" Value="#14181D"/>
</Trigger>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="BorderBrush" Value="#46505C"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="Bd" Property="Opacity" Value="0.65"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
<Setter Property="ItemContainerStyle">
<Setter.Value>
<Style TargetType="ComboBoxItem">
<Setter Property="Foreground" Value="White"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="Padding" Value="10,6"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ComboBoxItem">
<Border x:Name="ItemBorder"
Background="{TemplateBinding Background}"
Padding="{TemplateBinding Padding}">
<ContentPresenter />
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsHighlighted" Value="True">
<Setter TargetName="ItemBorder" Property="Background" Value="#2A313A"/>
</Trigger>
<Trigger Property="IsSelected" Value="True">
<Setter TargetName="ItemBorder" Property="Background" Value="#314256"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</Setter.Value>
</Setter>
</Style>
<!-- Botão secundário, caso use depois -->
<Style x:Key="DarkSmallButtonStyle" TargetType="Button">
<Setter Property="Height" Value="36"/>
<Setter Property="Padding" Value="14,6"/>
<Setter Property="Foreground" Value="White"/>
<Setter Property="Background" Value="#20252B"/>
<Setter Property="BorderBrush" Value="#323842"/>
<Setter Property="BorderThickness" Value="1"/>
<Setter Property="FontSize" Value="13"/>
<Setter Property="Cursor" Value="Hand"/>
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="Button">
<Border x:Name="Bd"
Background="{TemplateBinding Background}"
BorderBrush="{TemplateBinding BorderBrush}"
BorderThickness="{TemplateBinding BorderThickness}"
CornerRadius="10">
<ContentPresenter HorizontalAlignment="Center"
VerticalAlignment="Center"/>
</Border>
<ControlTemplate.Triggers>
<Trigger Property="IsMouseOver" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#2A3138"/>
<Setter TargetName="Bd" Property="BorderBrush" Value="#46505C"/>
</Trigger>
<Trigger Property="IsPressed" Value="True">
<Setter TargetName="Bd" Property="Background" Value="#151A1F"/>
</Trigger>
<Trigger Property="IsEnabled" Value="False">
<Setter TargetName="Bd" Property="Opacity" Value="0.65"/>
</Trigger>
</ControlTemplate.Triggers>
</ControlTemplate>
</Setter.Value>
</Setter>
</Style>
</UserControl.Resources>
<Grid Background="#111315">
<Grid.RowDefinitions>
<RowDefinition Height="Auto"/>
<RowDefinition Height="*"/>
</Grid.RowDefinitions>
<!-- CABEÇALHO -->
<StackPanel Grid.Row="0" Margin="16,16,16,0">
<Border Padding="18" CornerRadius="14" Background="#1A1D21" BorderBrush="#2A2E35" BorderThickness="1">
<StackPanel>
<DockPanel LastChildFill="False">
<StackPanel DockPanel.Dock="Left">
<TextBlock Text="Histórico operacional" FontSize="22" FontWeight="SemiBold" Foreground="White"/>
<TextBlock Margin="0,6,0,0" FontSize="13" Foreground="#B8C0CC">
<Run Text="Exibindo "/>
<Run Text="{Binding QuantidadeEventosFiltrados, Mode=OneWay}"/>
<Run Text=" eventos filtrados de "/>
<Run Text="{Binding QuantidadeEventos, Mode=OneWay}"/>
<Run Text=" eventos"/>
</TextBlock>
</StackPanel>
</DockPanel>
<StackPanel Margin="0,16,0,0">
<TextBlock Text="Busca e filtros" Margin="2,0,0,10" FontSize="12" Foreground="#8F99A5"/>
<WrapPanel>
<TextBox Width="260" Margin="0,0,10,10" Text="{Binding TextoBusca, UpdateSourceTrigger=PropertyChanged}" Style="{StaticResource DarkInputTextBoxStyle}" ToolTip="Buscar por título, descrição, fonte, módulo..." />
<ComboBox Width="150" Margin="0,0,10,10" ItemsSource="{Binding TiposTransicaoDisponiveis}" SelectedItem="{Binding TipoTransicaoSelecionado}" Style="{StaticResource DarkComboBoxStyle}" />
<ComboBox Width="150" Margin="0,0,10,10" ItemsSource="{Binding StatusDisponiveis}" SelectedItem="{Binding StatusSelecionado}" Style="{StaticResource DarkComboBoxStyle}" />
<ComboBox Width="170" Margin="0,0,10,10" ItemsSource="{Binding FontesDisponiveis}" SelectedItem="{Binding FonteSelecionada}" Style="{StaticResource DarkComboBoxStyle}" />
<ComboBox Width="160" Margin="0,0,10,10" ItemsSource="{Binding OrdenacoesDisponiveis}" SelectedItem="{Binding OrdenacaoSelecionada}" Style="{StaticResource DarkComboBoxStyle}" />
<Border Background="#111315" BorderBrush="#323842" BorderThickness="1" CornerRadius="10" Height="36" Padding="12,6" Margin="0,0,10,10">
<TextBlock VerticalAlignment="Center" Foreground="#B8C0CC" FontSize="12" Text="{Binding RoverIdSelecionado, StringFormat=Rover: {0}}" />
</Border>
</WrapPanel>
</StackPanel>
</StackPanel>
</Border>
</StackPanel>
<!-- LISTA -->
<Border Grid.Row="1"
Margin="16,0,16,16"
Padding="8"
CornerRadius="14"
Background="#16191D"
BorderBrush="#2A2E35"
BorderThickness="1">
<ListBox ItemsSource="{Binding EventosView}"
Background="Transparent"
BorderThickness="0"
ScrollViewer.VerticalScrollBarVisibility="Auto"
ScrollViewer.HorizontalScrollBarVisibility="Disabled"
VirtualizingPanel.IsVirtualizing="True"
VirtualizingPanel.VirtualizationMode="Recycling">
<ListBox.ItemContainerStyle>
<Style TargetType="ListBoxItem">
<Setter Property="Padding" Value="0"/>
<Setter Property="Margin" Value="0,0,0,10"/>
<Setter Property="HorizontalContentAlignment" Value="Stretch"/>
<Setter Property="Background" Value="Transparent"/>
<Setter Property="BorderThickness" Value="0"/>
<Setter Property="Focusable" Value="False"/>
</Style>
</ListBox.ItemContainerStyle>
<ListBox.ItemTemplate>
<DataTemplate>
<Border Background="#1D2126"
CornerRadius="12"
BorderBrush="#2B3138"
BorderThickness="1"
Padding="0">
<Grid>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="6"/>
<ColumnDefinition Width="110"/>
<ColumnDefinition Width="*"/>
<ColumnDefinition Width="110"/>
</Grid.ColumnDefinitions>
<!-- barra lateral -->
<Border Grid.Column="0"
Background="{Binding CorAccent}"
CornerRadius="12,0,0,12"/>
<!-- hora -->
<StackPanel Grid.Column="1"
VerticalAlignment="Center"
Margin="16,14,10,14">
<TextBlock Text="{Binding Hora}"
FontSize="20"
FontWeight="Bold"
Foreground="White"
HorizontalAlignment="Left"/>
<TextBlock Text="{Binding DataHoraCompleta}"
Margin="0,4,0,0"
FontSize="11"
Foreground="#9DA7B3"
TextWrapping="Wrap"/>
</StackPanel>
<!-- conteúdo -->
<StackPanel Grid.Column="2"
Margin="8,14,16,14">
<TextBlock Text="{Binding Titulo}"
FontSize="16"
FontWeight="SemiBold"
Foreground="White"
TextWrapping="Wrap"/>
<TextBlock Text="{Binding Descricao}"
Margin="0,8,0,0"
FontSize="13"
Foreground="#D0D7E2"
TextWrapping="Wrap"/>
<TextBlock Text="{Binding Subtitulo}"
Margin="0,10,0,0"
FontSize="12"
Foreground="#8F99A5"
TextWrapping="Wrap"/>
</StackPanel>
<!-- badge -->
<StackPanel Grid.Column="3"
Margin="0,14,14,14"
VerticalAlignment="Top"
HorizontalAlignment="Right">
<Border Background="{Binding CorBadge}"
CornerRadius="10"
Padding="10,4">
<TextBlock Text="{Binding TipoTransicao}"
Foreground="White"
FontSize="11"
FontWeight="SemiBold"
HorizontalAlignment="Center"/>
</Border>
</StackPanel>
</Grid>
</Border>
</DataTemplate>
</ListBox.ItemTemplate>
</ListBox>
</Border>
</Grid>
</UserControl>