Bonjour,
J'ai 4 boutons en hidden.

Voilà le code xaml :

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
 <s:SurfaceButton x:Name="offer1b4Button" Background="Black" Width="89" Height="67" Margin="13,0,0,0" VerticalAlignment="Bottom" HorizontalAlignment="Left" Visibility="Hidden"
                                     Style="{StaticResource MenuButtonStyle}" />
                    <s:SurfaceButton x:Name="offer2b4Button" Background="Black" Width="89" Height="67" Margin="115,0,0,0" VerticalAlignment="Bottom" HorizontalAlignment="Left" Visibility="Hidden"
                                     Style="{StaticResource MenuButtonStyle}" />
                    <s:SurfaceButton x:Name="offer3b4Button" Background="Black" Width="89" Height="67" Margin="222,0,0,0" VerticalAlignment="Bottom" HorizontalAlignment="Left" Visibility="Hidden"
                                     Style="{StaticResource MenuButtonStyle}" />
                    <s:SurfaceButton x:Name="offer4b4Button" Background="Black" Width="89" Height="67" Margin="329,0,0,0" VerticalAlignment="Bottom" HorizontalAlignment="Left" Visibility="Hidden"
                                     Style="{StaticResource MenuButtonStyle}" />
Dans mon c# j'ai un string contenant le name du bouton dont la propriété hidden doit être changée en visible.

Comment trouver les controls d'une application wpf par le name ?

Merci