<Grid>
<Grid.RowDefinitions>
<RowDefinition></RowDefinition>
</Grid.RowDefinitions>
</Grid>
<Button Grid.Row="1">
</Button>
bouton.SetValue(Grid.RowProperty, 1);
<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 TextElement.FontSize="20">
<Button Width="100" Height="100" VerticalAlignment="Center" HorizontalAlignment="Center">
Hello
</Window>
class MonControle : Control
{
public static readonly DependencyProperty ValeurProperty;
static MonControle()
ValeurProperty = DependencyProperty.RegisterAttached("Valeur", typeof(float), typeof(MonControle));
}