En pocas palabras, si está tratando de hacer que la barra de progreso comience, pero como una barra indeterminada, entonces debe establecer la propiedad IsIndeterminate en verdadero cuando esté listo y en false cuando termine.
Así, en otras palabras:
pbar.IsIndeterminate = true; //This starts your bar's animation
pbar.IsIndeterminate = false; //This stops your bar's animation
Para darles contexto en cuanto a por qué desea hacerlo de esta manera de mirar en la siguiente pseudo código:
//Some method that is going to start something that is going to take a while
public void StartLongRunningProcess()
{
//Make a call to a web service asynchronously etc...
//Start the animation for your progress bar
pbar.IsIndeterminate = true;
}
//The method (delegate) that handles the result, usually from an event.
//This method will handle the result of the asynchronous call
public void HandlerForLongRunningProcess()
{
//Do stuff with result from your asynchronous web service call etc...
//Stop the animation for your progress bar
pbar.IsIndeterminate = false;
}
Voy a ser el primero para decir que no estoy seguro de si este es el uso previsto de esta propiedad, pero puedo decir que definitivamente funciona.
¿Por qué tiene 'IsIndeterminate =" True "' en primer lugar? –