agrobot_base/AgroBase/OperationControl/Windows/DockWindow.xaml

138 lines
6.7 KiB
Plaintext
Raw Normal View History

<Window x:Class="OperationControl.Windows.DockWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
xmlns:local="clr-namespace:OperationControl.Windows"
xmlns:conv="clr-namespace:OperationControl.Converters"
mc:Ignorable="d"
Title="DockWindow" Height="1025" Width="1920" WindowStartupLocation="CenterScreen" WindowState="Maximized">
<Window.Resources>
<conv:NullToVisibilityConverter x:Key="NullToVisibilityConverter" />
</Window.Resources>
<Grid>
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="110"/>
<!-- Topo -->
<RowDefinition Height="*"/>
<!-- Centro -->
<RowDefinition Height="90"/>
<!-- Rodapé -->
</Grid.RowDefinitions>
<Grid.ColumnDefinitions>
<ColumnDefinition Width="{Binding LeftPanelWidth}"/>
<!-- Lateral esquerda (voltar) -->
<ColumnDefinition Width="*"/>
<!-- Centro -->
<ColumnDefinition Width="{Binding RightPanelWidth}"/>
<!-- Lateral direita (avançar) -->
</Grid.ColumnDefinitions>
<!-- Topo (span em 3 colunas) -->
<Border Grid.Row="0" Grid.ColumnSpan="3" Background="#222">
<ContentControl Content="{Binding TopContent}"/>
</Border>
<!-- Área central principal -->
<Border Grid.Row="1" Grid.Column="1" Margin="8" BorderThickness="1" BorderBrush="Gray">
<ContentControl Content="{Binding CenterContent}"/>
</Border>
<!-- Rodapé (span 3 colunas) -->
<Border Grid.Row="2" Grid.ColumnSpan="3" Background="#181818" Padding="5">
<ContentControl Content="{Binding BottomContent}"/>
</Border>
<!-- Lateral esquerda -->
<Grid Grid.Row="1" Grid.Column="0" Margin="8">
<ContentControl Content="{Binding LeftContent}">
<ContentControl.Style>
<Style TargetType="ContentControl">
<Setter Property="Content" Value="{x:Null}"/>
<Style.Triggers>
<DataTrigger Binding="{Binding LeftContent}" Value="{x:Null}">
<Setter Property="Template">
<Setter.Value>
<ControlTemplate TargetType="ContentControl">
<Grid>
<Button Content="⮜"
FontSize="24"
HorizontalAlignment="Center"
VerticalAlignment="Center"
Width="40"
Height="40"
Command="{Binding BackCommand}"
IsEnabled="{Binding CanGoBack}"/>
</Grid>
</ControlTemplate>
</Setter.Value>
</Setter>
</DataTrigger>
</Style.Triggers>
</Style>
</ContentControl.Style>
</ContentControl>
</Grid>
<!-- Lateral direita -->
<Border Grid.Row="1" Grid.Column="2" Margin="8" BorderThickness="1" BorderBrush="#404040" Background="#1C1C1C">
<ContentControl Content="{Binding RightContent}"/>
</Border>
</Grid>
<!-- Overlay global -->
<Grid Panel.ZIndex="9999">
<Border HorizontalAlignment="Right"
VerticalAlignment="Top"
Margin="0,20,20,0"
Padding="10,8"
CornerRadius="8"
Background="#1C1F23"
BorderBrush="#3A424F"
BorderThickness="1"
Cursor="Hand"
Visibility="{Binding BottomVM.ToastAlerta, Converter={StaticResource NullToVisibilityConverter}}"
MouseLeftButtonUp="ToastAlerta_MouseLeftButtonUp">
<Border.Style>
<Style TargetType="Border">
<Setter Property="Opacity" Value="0.95"/>
<Style.Triggers>
<DataTrigger Binding="{Binding BottomVM.ToastAlerta.Severidade}" Value="Warning">
<Setter Property="BorderBrush" Value="#EFBF2F"/>
</DataTrigger>
<DataTrigger Binding="{Binding BottomVM.ToastAlerta.Severidade}" Value="Error">
<Setter Property="BorderBrush" Value="#FF5656"/>
</DataTrigger>
<DataTrigger Binding="{Binding BottomVM.ToastAlerta.Severidade}" Value="Critical">
<Setter Property="BorderBrush" Value="#FF5656"/>
<Setter Property="Background" Value="#3A171C"/>
</DataTrigger>
</Style.Triggers>
</Style>
</Border.Style>
<StackPanel Orientation="Horizontal">
<TextBlock Text="{Binding BottomVM.ToastAlerta.Icone}" FontSize="16" Margin="0,0,6,0"/>
<StackPanel>
<StackPanel Orientation="Horizontal">
<Border Background="#2F3B4A" CornerRadius="4" Padding="4,1" Margin="0,0,6,0">
<TextBlock Text="{Binding BottomVM.ToastAlerta.Rover_ID}" Foreground="White" FontSize="10" FontWeight="Bold"/>
</Border>
<TextBlock Text="{Binding BottomVM.ToastAlerta.Titulo}" FontWeight="Bold" Foreground="#F5F7FA" FontSize="11"/>
</StackPanel>
<TextBlock Text="{Binding BottomVM.ToastAlerta.Mensagem}" Foreground="#B7C0CC" FontSize="10" TextWrapping="Wrap" MaxWidth="320"/>
</StackPanel>
</StackPanel>
</Border>
</Grid>
</Grid>
</Window>