I want the picture and the text to appear after I click the button.
How to do it?
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 .
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 .
Source: https://ru.stackoverflow.com/questions/530021/
All Articles