示例#1
0
        static void SetTextBasedOnBusy(ButtonWithBusyIndicator control, bool isBusy, string text)
        {
            var activityIndicator = GetActivityIndicator(control);
            var button            = GetButton(control);

            if (activityIndicator == null || button == null)
            {
                return;
            }

            activityIndicator.IsVisible = activityIndicator.IsRunning = isBusy;
            button.Text = isBusy ? string.Empty : control.Text;
        }
示例#2
0
 static Button GetButton(ButtonWithBusyIndicator control)
 {
     return(control.Children[0] as Button);
 }
示例#3
0
 static ActivityIndicator GetActivityIndicator(ButtonWithBusyIndicator control)
 {
     return(control.Children[1] as ActivityIndicator);
 }