<UserControl x:Class="CtrEditor.ObjetosSim.ucGearEncoder"
             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:CtrEditor.ObjetosSim.UserControls"
             xmlns:vm="clr-namespace:CtrEditor.ObjetosSim"
             mc:Ignorable="d">

    <UserControl.DataContext>
        <vm:osGearEncoder Dientes="9"/>
    </UserControl.DataContext>

    <Grid>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="{Binding Radio_Externo, Converter={StaticResource MeterToPixelConverter}, ConverterParameter=1}"/>
            <ColumnDefinition Width="{Binding Radio_Externo, Converter={StaticResource MeterToPixelConverter}, ConverterParameter=0.02}"/>
            <!-- Espacio entre el Rectangle y el Canvas -->
            <ColumnDefinition Width="{Binding Radio_Externo, Converter={StaticResource MeterToPixelConverter}, ConverterParameter=1}"/>
        </Grid.ColumnDefinitions>

        <!-- StackPanel to contain the Rectangle -->
        <Canvas Grid.Column="0" HorizontalAlignment="Right">
            <Rectangle  Canvas.Top="{Binding Radio_Externo, Converter={StaticResource MeterToPixelConverter}, ConverterParameter=-0.12}"
                Grid.Column="0" Width="{Binding Radio_Externo, Converter={StaticResource MeterToPixelConverter}, ConverterParameter=1}" 
                       Height="{Binding Radio_Externo, Converter={StaticResource MeterToPixelConverter}, ConverterParameter=0.25}" 
                       Fill="{Binding Color_oculto}"                       
                       HorizontalAlignment="Left" VerticalAlignment="Center"/>
        </Canvas>
        <Canvas Grid.Column="0" HorizontalAlignment="Left">
            <Canvas.RenderTransform>
                <RotateTransform Angle="{Binding Angulo}" CenterX="0" CenterY="0"/>
            </Canvas.RenderTransform>

            <local:GearControl ToothWidthRatio="{Binding Ancho_Dientes}" TeethCount="{Binding Dientes}" 
                               InnerRadius="{Binding Radio_Interno, Converter={StaticResource MeterToPixelConverter}}" 
                               OuterRadius="{Binding Radio_Externo, Converter={StaticResource MeterToPixelConverter}}"
                               HorizontalAlignment="Center" VerticalAlignment="Center" />
        </Canvas>
    </Grid>
</UserControl>
