I want the picture and the text to appear after I click the button.

How to do it?

Closed due to the fact that the question is too general for the participants VenZell , D-side , cheops , zRrr , ReinRaus Jun 4 '16 at 19:34 .

Please correct the question so that it describes the specific problem with sufficient detail to determine the appropriate answer. Do not ask a few questions at once. See “How to ask a good question?” For clarification. If the question can be reformulated according to the rules set out in the certificate , edit it .

  • According to the rules of the forum, the questions should not be reduced to the decision or the completion of educational tasks for students. Please clarify what you have done yourself and what did not work out. - VenZell

2 answers 2

You can do this:

<Button Click="someButton_Click"> <Button.Content> <StackPanel Name="someContent" Visibility="Hidden"> <TextBlock Text="Button Content"/> </StackPanel> </Button.Content> </Button> 

And the event handler:

 private void someButton_Click(object sender, RoutedEventArgs e) { someContent.Visibility = Visibility.Visible; } 

    The way to do this in the framework of MVVM is to bind the command to the button, upon the arrival of the command set change the boolean property from false to true . To bind the property of the desired UI block via the BooleanToVisibilityConverter .