<UserControl x:Class="MeterVision.Mark.UCMark"
             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:MeterVision.Mark"
             mc:Ignorable="d" 
             Background="White"
             d:DesignHeight="450" d:DesignWidth="600">
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition Height="30" />
            <RowDefinition Height="*" />
        </Grid.RowDefinitions>

        <Border Grid.Row="0" BorderThickness="0 0 0 1" BorderBrush="#ACAAAA" Background="AliceBlue" Padding="10 0 0 0">
            <Grid>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                    <ColumnDefinition Width="Auto" />
                </Grid.ColumnDefinitions>

                <StackPanel x:Name="pnlMarkFunc" Orientation="Horizontal" Grid.Column="0" Background="Transparent" Visibility="Visible">
                    <Button x:Name="btnMeterRegion" Content="标注表盘" Foreground="Black" FontSize="14px" 
                        Click="BtnMeterRegion_Click" Background="Transparent" BorderThickness="0" />
                    <TextBlock Width="1" Background="#686868" Margin="5 5 5 5" Visibility="Visible" />
                    <Button x:Name="btnFeatureRegion" Content="标注特征区域" FontSize="14px" 
                        Click="BtnFeatureRegion_Click" Background="Transparent" BorderThickness="0" />
                    <TextBlock x:Name="txtFeatureRegion" Width="1" Background="#686868" Margin="5 5 5 5" Visibility="Visible" />
                    <Button x:Name="btnClearMark" Content="清除标注" FontSize="14px" 
                            Click="BtnClearMark_Click" Background="Transparent" BorderThickness="0"/>
                </StackPanel>
                <TextBlock x:Name="txtCurPoint" Grid.Column="2" Text="坐标: x,y" Width="200"  FontSize="14px" VerticalAlignment="Center"  />
            </Grid>
        </Border>

        <Border x:Name="pnlCanvas" Grid.Row="1" BorderBrush="#ACAAAA" BorderThickness="0" Margin="5" Padding="0" 
                SizeChanged="PnlCanvas_SizeChanged">
            <Canvas Name="drawingCanvas"  HorizontalAlignment="Center" VerticalAlignment="Center"                        
                    MouseDown="DrawingCanvas_MouseDown" MouseMove="DrawingCanvas_MouseMove"
                    MouseUp="DrawingCanvas_MouseUp" MouseEnter="DrawingCanvas_MouseEnter"
                    MouseLeave="DrawingCanvas_MouseLeave" Background="Transparent">
                <Image Name="imgControl" Stretch="None" >
                    <Image.RenderTransform>
                        <ScaleTransform x:Name="scaleTransform" ScaleX="1.5" ScaleY="1.5" />
                    </Image.RenderTransform>
                </Image>
                <!--<Rectangle Fill="#60FF0000" 
                       Width="{Binding ActualWidth, ElementName=drawingCanvas}"
                       Height="{Binding ActualHeight, ElementName=drawingCanvas}"
                       Canvas.Left="{Binding (Canvas.Left), ElementName=drawingCanvas}"
                       Canvas.Top="{Binding (Canvas.Top), ElementName=drawingCanvas}"/>-->
            </Canvas>
        </Border>

    </Grid>
</UserControl>
