Dispenser/DispenserUI/Views/Common/SystemStatusView.axaml

67 lines
3.8 KiB
Plaintext
Raw Permalink Normal View History

2024-08-16 07:20:09 +00:00
<UserControl xmlns="https://github.com/avaloniaui"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:common="clr-namespace:DispenserUI.ViewModels.Common"
xmlns:anim="https://github.com/whistyun/AnimatedImage.Avalonia"
Width="143" Height="1000"
x:DataType="common:SystemStatusVM"
x:Class="DispenserUI.Views.Common.SystemStatusView">
<Grid RowDefinitions="*,100">
<StackPanel Grid.Row="0" HorizontalAlignment="Center" Margin="0,20,0,20">
<Grid HorizontalAlignment="Center" VerticalAlignment="Center">
<Border Width="120" Height="120" CornerRadius="60" Name="StatusBorder"
Background="{Binding LightColor}"
BoxShadow="{Binding LightShadow}"
HorizontalAlignment="Center"
VerticalAlignment="Center">
<TextBlock VerticalAlignment="Center" Name="StatusText" Text="{Binding LightState}" FontSize="22"
FontWeight="Bold"
Foreground="White"
TextAlignment="Center" />
</Border>
</Grid>
<Grid HorizontalAlignment="Center" VerticalAlignment="Center" Margin="0,10,0,0"
Background="{Binding Camera.Background}">
<Border Width="143" Height="100">
<Button HorizontalAlignment="Stretch"
BorderThickness="0"
CornerRadius="0"
Background="Transparent"
Command="{Binding ToCameraViewer}"
VerticalAlignment="Stretch">
<StackPanel VerticalAlignment="Center" HorizontalAlignment="Center">
<Image Source="/Assets/UI/camera@2x.png" Width="26" Height="26"
IsVisible="{Binding Camera.IsNormal}" />
<Image Width="26" Height="26"
IsVisible="{Binding Camera.IsNormal,Converter={StaticResource BoolConverter},ConverterParameter='false'}"
anim:ImageBehavior.AnimatedSource="avares://DispenserUI/Assets/loading_b.gif" />
<TextBlock Text="视觉相机" TextAlignment="Center" Margin="0,10,0,0" FontSize="14"
FontWeight="Thin" />
<TextBlock Text="{Binding Camera.Tip}"
IsVisible="{Binding Camera.IsNormal,Converter={StaticResource BoolConverter},ConverterParameter='false'}"
TextAlignment="Center" Foreground="#DF1C41" Margin="0,10,0,0"
FontSize="10"
FontWeight="Thin" />
</StackPanel>
</Button>
</Border>
</Grid>
</StackPanel>
<Border Grid.Row="1" Width="80" Height="80" CornerRadius="50"
BoxShadow="0 0 10 2 #FF7020"
Margin="0,0,0,30"
HorizontalAlignment="Center"
Cursor="Hand"
VerticalAlignment="Center">
<Button Width="80" Height="80" CornerRadius="40"
Background="Red"
BorderThickness="0"
Command="{Binding ToDisableAll}"
HorizontalAlignment="Center">
<Image Source="/Assets/UI/stop-big.png"
Cursor="Hand"
Width="80" Height="80"
VerticalAlignment="Center" />
</Button>
</Border>
</Grid>
</UserControl>