Einfach ausgedrückt, wenn Sie versuchen, den Fortschrittsbalken zu starten, aber als unbestimmter Balken, dann müssen Sie die Eigenschaft IsIndeterminate auf True setzen, wenn fertig und auf False, wenn Sie fertig sind.
Also mit anderen Worten:
pbar.IsIndeterminate = true; //This starts your bar's animation
pbar.IsIndeterminate = false; //This stops your bar's animation
Um Ihnen Kontext, warum Sie wollen würde, es auf diese Weise Blick auf den folgenden Pseudo-Code zu tun:
//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;
}
Lassen Sie mich die ersten sein, zu sagen, dass ich nicht sicher bin, ob dies die beabsichtigte Verwendung dieser Eigenschaft ist, aber ich kann sagen, dass es definitiv funktioniert.
Warum haben Sie 'IsIndeterminate =" True "' an erster Stelle? –