class MonControle : Control
{
public static readonly DependencyProperty ValeurProperty;
static MonControle()
ValeurProperty = DependencyProperty.Register("Valeur", typeof(float), typeof(MonControle));
}
public float Valeur
get
return (float)GetValue(ValeurProperty);
set
SetValue(ValeurProperty, value);
<Trigger Property="Valeur" Value="0">
<Setter Property="Visibility" Value="Hidden" />
</Trigger>
<Window x:Class="WindowsApplication1.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="WindowsApplication1" Height="300" Width="300"
>
<Grid>
<Button Width="100" Height="100" VerticalAlignment="Center" HorizontalAlignment="Center">
Hello
</Button>
</Grid>
</Window>
FontSize="20"