<UserControl x:Class="BOB.Views.UserControls.NumericalDisplay"
             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:BOB.Views.UserControls"
             xmlns:prism="http://prismlibrary.com/"
             prism:ViewModelLocator.AutoWireViewModel="True"
             mc:Ignorable="d"
             d:DesignHeight="450"
             d:DesignWidth="800">

    <Grid>
        <Border Background="{Binding BackgroundColor}"
                CornerRadius="16"
                Padding="16"
                Margin="5">
            <Border.Effect>
                <DropShadowEffect BlurRadius="8"
                                  ShadowDepth="4"
                                  Opacity="0.3" />
            </Border.Effect>
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="1.3*" />
                    <RowDefinition Height="6.2*" />
                    <RowDefinition Height="1*" />
                </Grid.RowDefinitions>

                <!-- 通道号 -->
                <Viewbox>
                    <TextBlock HorizontalAlignment="Center"
                               FontSize="18"
                               FontWeight="Bold">
                        <Run Text="{Binding ChannelNumber}" />
                    </TextBlock>
                </Viewbox>

                <!-- 温度 -->
                <Viewbox Grid.Row="1">
                    <TextBlock Text="{Binding MonitorValue, StringFormat='0.00'}"
                               FontSize="40"
                               FontWeight="SemiBold"
                               Foreground="{Binding TextColor}"
                               HorizontalAlignment="Center"
                               VerticalAlignment="Center" />
                </Viewbox>

                <!-- 上下限 -->
                <Viewbox Grid.Row="2">
                    <StackPanel Orientation="Horizontal"
                                HorizontalAlignment="Center"
                                Visibility="{Binding LimitsVisibility}">
                        <TextBlock Text="下限: "
                                   FontSize="12"
                                   Foreground="Gray" />
                        <TextBlock Text="{Binding LowerLimit, StringFormat='0.00'}"
                                   FontSize="12"
                                   FontWeight="Bold"
                                   Foreground="Gray"
                                   Margin="0,0,10,0" />
                        <TextBlock Text="上限: "
                                   FontSize="12"
                                   Foreground="Gray" />
                        <TextBlock Text="{Binding UpperLimit, StringFormat='0.00'}"
                                   FontSize="12"
                                   FontWeight="Bold"
                                   Foreground="Gray" />
                    </StackPanel>
                </Viewbox>
            </Grid>
        </Border>
    </Grid>
</UserControl>
