BUsy Indicator Not Showing Up

2 posts, 0 answers
  1. Josh
    Josh avatar
    17 posts
    Member since:
    Aug 2012

    Posted 03 May Link to this post

    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;
                        }
                    });
                }
            }

     

  2. Nasko
    Admin
    Nasko avatar
    587 posts

    Posted 05 May Link to this post

    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.
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top