<UserControl x:Class="MegaRobo.C00225155App.MenuViews.PowderBottleUserControl"
             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:BooleanToVisibilityConverter x:Key="BooleanToVisibilityConvert" />
        <convert:PowderStringToBackgroundConverter x:Key="powderstringToBrushColorConvert" />
        <convert:DivisionConverter  x:Key="DivisionConverter"/>
    </UserControl.Resources>
    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="45"/>
            <ColumnDefinition/>
        </Grid.ColumnDefinitions>
        <StackPanel Margin="0" Background="Transparent" >
            <!-- 绘制瓶子形状 -->
            <Border Margin="0,0,0,0" x:Name="BottlePath"  
                    Background="{Binding PowderBottleModel.PowderDisplayColor,RelativeSource={RelativeSource AncestorType=UserControl}}" 
                    BorderBrush="LightGray"  
                    BorderThickness="1" CornerRadius="14" Height="30" Width="35"  MouseLeftButtonDown="BorderMouseLeftButtonDown">
                <TextBlock Text="{Binding PowderBottleModel.SourcePowderName,RelativeSource={RelativeSource AncestorType=UserControl}}" 
                           FontSize="10" VerticalAlignment="Center" HorizontalAlignment="Center"/>
            </Border>


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