Babalaus
Babalaus

Reputation: 49

WPF MVVM Change button content with loading user control

I have a simple window with two buttons on bottom, when one button is clicked it change the view model of my main window, the name of the content button and the command.

I would like that when user click on the button change this with a loading user control i already have but i'm stacked, i don't know it's something i can implement with xaml or i need some code on my view model.

Any suggestions would be appreciated. Thanks.

Upvotes: 0

Views: 660

Answers (1)

pete the pagan-gerbil
pete the pagan-gerbil

Reputation: 3166

You will need some code on your ViewModel to swap out the Button for the Loading control. You can either do this with binding ContentControls or with a Boolean property to set one to visible and the other to hidden while the loading happens.

Upvotes: 1

Related Questions