49 lines
2.2 KiB
XML
49 lines
2.2 KiB
XML
<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:local="clr-namespace:CtrEditor.ObjetosSim"
|
|
mc:Ignorable="d"
|
|
xmlns:convert="clr-namespace:CtrEditor.Convertidores">
|
|
|
|
<UserControl.Resources>
|
|
<convert:MeterToPixelConverter x:Key="MeterToPixelConverter"/>
|
|
<convert:LevelToHeightMultiConverter x:Key="LevelToHeightMultiConverter"/>
|
|
<convert:WidthPercentageConverter x:Key="WidthPercentageConverter"/>
|
|
</UserControl.Resources>
|
|
|
|
<Grid>
|
|
<Image x:Name="TankImage"
|
|
Source="/imagenes/tank.png"
|
|
Width="{Binding Alto, Converter={StaticResource MeterToPixelConverter}}"
|
|
Height="{Binding Ancho, 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>
|