This is a migrated thread and some comments may be shown as answers.

BUsy Indicator Not Showing Up

1 Answer 224 Views
BusyIndicator
This is a migrated thread and some comments may be shown as answers.
Josh
Top achievements
Rank 1
Josh asked on 03 May 2016, 09:07 PM

I am using MVVM to display a busy indicator. If I tell the indicator to show in an async on click event in code behind it shows up. However when I have my view model set the exact same property to true from a command it never shows up.

 

<telerik:RadBusyIndicator Name="LoggingInBusyIndicator" BusyContent="Logging In" IsBusy="{Binding ShowLoginIndicator}" DisplayAfter="0">
<!--Button code inside of grid-->
    </telerik:RadBusyIndicator>
 
  private async void InstructorLoginButton_Click(object sender, RoutedEventArgs e)
        {
 
            MainMenuViewModel pageViewModel = (this.DataContext as MainMenuViewModel);
 
            pageViewModel.ShowLoginIndicator = true;
 
            try
            {
                //Do login stuff
            }
            catch (UserLoginException ule)
            {
                pageViewModel.SetInstructorLoginError(ule.Message);
            }
 
            pageViewModel.ShowLoginIndicator = false;
 
        }

View Model Code the indicator never shows but if I remove the async call it shows up.

      private RelayCommand studentLoginCommand;
        public RelayCommand StudentLonginCommand
        {
            get
            {
                return studentLoginCommand = studentLoginCommand ?? new RelayCommand(async() =>
                {
                    ShowLoginIndicator = true;
                    
 
                    bool isStudentloggedIn = await LoginStudent();
if (isStudentloggedIn)
{
//Handle login
ShoLoginIndicator=false;
 
                    }
                    else
                    {
                        ShowLoginIndicator = false;
                    }
                });
            }
        }

 

1 Answer, 1 is accepted

Sort by
0
Nasko
Telerik team
answered on 05 May 2016, 12:25 PM
Hello Josh,

We check the provided code-snippet and it seems everything is working as expected on our side - the BusyIndicator gets visualized as expected when the command is executed.

Please, check the attached sample project we used for our investigation and modify it order to reproduce the observed by you behavior - thus we could be able to continue our investigation and provide you with a prompt solution.

We are looking forward to hearing from you.

Regards,
Nasko
Telerik
Do you need help with upgrading your AJAX, WPF or WinForms project? Check the Telerik API Analyzer and share your thoughts.
Tags
BusyIndicator
Asked by
Josh
Top achievements
Rank 1
Answers by
Nasko
Telerik team
Share this question
or