<UserControl x:Class="CtrEditor.ObjetosSim.ucTanque" 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:vm="clr-namespace:CtrEditor.ObjetosSim" mc:Ignorable="d"> <UserControl.DataContext> <vm:osTanque Alto="1" Ancho="1" Angulo="-4" /> </UserControl.DataContext> <Grid> <Image x:Name="TankImage" Source="/imagenes/tank.png" Width="{Binding Ancho, Converter={StaticResource MeterToPixelConverter}}" Height="{Binding Alto, Converter={StaticResource MeterToPixelConverter}}" Stretch="Uniform"> </Image> <Slider HorizontalAlignment="Left" VerticalAlignment="Center" Height="{Binding Alto, Converter={StaticResource MeterToPixelConverter}}" Orientation="Vertical" Value="{Binding Level}" Maximum="100"/> <Rectangle x:Name="WaterLevel" Fill="Blue" VerticalAlignment="Bottom" HorizontalAlignment="Center"> <Rectangle.Width> <Binding ElementName="TankImage" Path="ActualWidth" Converter="{StaticResource WidthPercentageConverter}" /> </Rectangle.Width> <Rectangle.Height> <MultiBinding Converter="{StaticResource LevelToHeightMultiConverter}"> <Binding Path="Level" /> <Binding ElementName="TankImage" Path="ActualHeight" /> </MultiBinding> </Rectangle.Height> </Rectangle> <Label Content="{Binding Level}" HorizontalAlignment="Center" Margin="10,10,0,0" VerticalAlignment="Top"/> </Grid> </UserControl>