Inserted in the percentage of progress BusyContent

4 posts, 0 answers
  1. Cristina
    Cristina avatar
    16 posts
    Member since:
    Nov 2010

    Posted 13 Dec 2010 Link to this post

    Hi, I have in my project BusyIndicator control. Works great, but I would add in the BusyContent an indicator with the percentage of progress as they have in the example http://demos.telerik.com/silverlight/ # BusyIndicator / Configurator. I would appreciate an example code.
    Thank you very much
  2. Teodor
    Admin
    Teodor avatar
    501 posts

    Posted 14 Dec 2010 Link to this post

    Hi Cristina,

    To achieve that you need to set the following:

    • ProgressValue property of the RadBusyIndicator (value from 1 to 100), whenever you know in your code what progress you have made
    • IsIndeterminate property of the RadBusyIndicator - set it to false to enable it to report progress
    • BusyContent property of the RadBusyIndicator (optional) - in case you need for instance to write how many percent have passed.


    Sample code for how all this can be implemented is just at the same example you have referred:
    http://demos.telerik.com/silverlight/#BusyIndicator/Configurator

    Just click on View Code and see the declaration in XAML:

    <telerik:RadBusyIndicator x:Name="busyIndicator"
                    IsBusy="{Binding IsBusy}"
                    IsIndeterminate="{Binding IsIndeterminate}"
                    ProgressValue="{Binding ProgressValue}"
                    BusyContent="{Binding BusyContent}"
                    DisplayAfter="{Binding DisplayAfter}">
                <Image Source="../Images/BusyIndicator/Scheduler.png" Style="{StaticResource AntiAliasedImageStyle}" />
            </telerik:RadBusyIndicator>

    You can see how the properties can be set in the BusyIndicatorViewModel.cs file.

    Hope this helps. Let us know in case you need further assistance.

    Greetings,
    Teodor
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
  3. DevCraft banner
  4. Cristina
    Cristina avatar
    16 posts
    Member since:
    Nov 2010

    Posted 14 Dec 2010 Link to this post

    Teodor, thanks for responding. As I commented in my code I have put everything he says in the above example and see only the busyIndicator without progress in percentage. The truth is I do not know what I'm doing wrong. This is my code:
    <telerik:RadBusyIndicator x:Name="busyIndicator"
                                          BusyContent="{Binding BusyContent}"                                      
                                          IsBusy="{Binding IsBusy}"
                                          ProgressValue="{Binding ProgressValue}"
                                          Style="{StaticResource RadBusyIndicatorStyle1}"
                                          IsIndeterminate="{Binding IsIndeterminate}"
                                          >               

    And BusyIndicatorViewModel.cs code is the same as the example.
    Again I would appreciate a sample project so I can determine what my error.
    Thanks
  5. Teodor
    Admin
    Teodor avatar
    501 posts

    Posted 20 Dec 2010 Link to this post

    Hello Cristina,

    Please accept our apology on the late response. 

    Find attached a solution that shows how progress can be reported. Please note that we set the IsIndeterminate to false in the ViewModel's constructor:

    public BusyIndicatorViewModel()
    {
        this.IsIndeterminate = false;
        this.BusyContent = "Loading...";
        this.IsBusy = true;
         
        progressValueTimer = new DispatcherTimer();
        progressValueTimer.Interval = TimeSpan.FromMilliseconds(500);
        progressValueTimer.Tick += OnProgressValueTimerTick;
        progressValueTimer.Start();
    }

    Hope this helps. Let us know in case you need more assistance.

    Best wishes,
    Teodor
    the Telerik team
    Browse the videos here>> to help you get started with RadControls for Silverlight
Back to Top