<UserControl x:Class="MegaRobo.C00225155App.MenuViews.LiquidBottleUserControl"
             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:MegaRobo.C00225155App.MenuViews"
             xmlns:loca="clr-namespace:MegaRobo.C00225155App.MenuViews.Bottles"
             xmlns:convert="clr-namespace:MegaRobo.C00225155App.Converters"
             mc:Ignorable="d" 
             d:DesignHeight="48" d:DesignWidth="45"  Height="48" Width="45">
    <UserControl.Resources>
        <convert:DivisionConverter  x:Key="DivisionConverter"/>
        <convert:BooleanToVisibilityConverter x:Key="BoolenToVisibilityConverter"/>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="45"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <StackPanel >
            <!-- 绘制瓶子形状 -->
            <Border Margin="0" x:Name="BottlePath" 
                    Background="{Binding LiquidBottleModel.LiquidDisplayColor,RelativeSource={RelativeSource AncestorType=UserControl}}"  
                    BorderBrush="LightGray"  
                    BorderThickness="1" CornerRadius="14" Height="30" Width="35"  MouseLeftButtonDown="Bottle_MouseLeftButtonDown">
                <TextBlock Text="{Binding LiquidBottleModel.SourceLiquidName,RelativeSource={RelativeSource AncestorType=UserControl}}" 
                           FontSize="10" VerticalAlignment="Center" HorizontalAlignment="Center"/>
            </Border>

            <Border  BorderBrush="LightGray" BorderThickness="1" CornerRadius="2" Height="18" Width="45"  Visibility="{Binding LiquidBottleModel.HaveBottle,RelativeSource={RelativeSource AncestorType=UserControl},Converter={StaticResource BoolenToVisibilityConverter}}">
                <TextBlock  TextAlignment="Center"  Text="{Binding LiquidBottleModel.OriginVolume,StringFormat=f2, RelativeSource={RelativeSource AncestorType=UserControl}}"   FontSize="10"/>
            </Border>
            
        </StackPanel>

    </Grid>
</UserControl>
