two Probleme with BusyIndicator

9 posts, 1 answers
  1. Alexander
    Alexander avatar
    6 posts
    Member since:
    Aug 2010

    Posted 18 Aug 2010 Link to this post

    Hi i have two problems with the RadBusyIndicator...
    i placed some controls in an RadBusyIndicator, something like this...

    <RadWindow>
        <RadBusyIndicator name="busyIndicator">
            <Grid>
                <... />
                <TextBox name="textBox" />
                <... />
            </Grid>
        </RadBusyIndicator>
    </RadWindow>

    after i changed the busyIndicator.IsBusy, the focuse of the textBox inside the BusyIndicator is lost.

    to prevent this i tried to call...

    busyIndicator.IsBusy=false;
    textBox.Focus();

    but the focus is still lost. i think because of the blending animation of the busyIndicator - it will release its focus after the animation - but when is the animation over (an event for that will be helpfull).

    thats the first problem - loosing focus and impossible to "refocus" an control imediately after busyIndicator.IsBusy=false.

    the second problem i have is, i changed the busyIndicator.DisplayAfter timespan to a higher value {e.g. TimeSpan.FromSeconds(1.23)}, with the result...
    after busyIndicator.IsBusy = true; ... busyIndicator.IsBusy=false; ... the busyIndicator looks like an disabled control and all controls inside the busyIndicator are not accessable anymore... why ?!?!?!

    see attached pictures...
    "busyindicator_isbusy_true.png" - thats ok,
    "busyindicator_isbusy_false_ok.png" - this is ok also (DisplayAfter is not touched),
    "busyindicator_isbusy_false_fault.png" - thats with changed DisplayAfter value (>250ms)
    (not possible to upload pictures ?!?!)

    an other code fragment, how i use the IsBusy property...

    private void xyz()
    {
        MyWebServiceClient client = new MyWebServiceClient();

        client.MyMethodCompleted += (sender, e) =>
        {
            // here the called method of WebService is finished
            busyIndicator.IsBusy = false;
            ...
        };

        busyIndicator.IsBusy = true;
        // calling the WebService method
        client.MyMethodAsync();
    }

    can anybody give me a solution...? {hopefully yes :)}

    Dev. Env. / Project:
    Telerik RadControls for Silverlight4 Q2 2010
    Microsoft VS 2010
    Microsoft Silverlight 4
  2. Alexander
    Alexander avatar
    6 posts
    Member since:
    Aug 2010

    Posted 19 Aug 2010 Link to this post

    one of the problems fixed! (the second one)

    i moved the call of busyIndicator.IsBusy from 

            private void radWindow_Loaded(object sender, RoutedEventArgs e)
            {
                // at this place, all controls inside RadBusyIndicator are disabled and stay disabled (with changed DisplayAfter value >250ms)
                // xyz();
            }

    to 
            private void radWindow_Opened(object sender, RoutedEventArgs e)
            {
                // at this place the controls inside RadBusyIndicator are enabled/disabled by the BusyIndicator like expect.
                xyz();
            }

    ok... thats fixed...

    but i have still the other problem with losing the focus - (i have no idea where to bring back the focus to the control after busyIndicator.IsBusy=false; imediately after that statement has no effect)
  3. DevCraft banner
  4. Answer
    Teodor
    Admin
    Teodor avatar
    501 posts

    Posted 20 Aug 2010 Link to this post

    Hello Alexander,

    Thank you for contacting us.

    We are glad you have resolved one of your issues. Let us address the first one.

    Indeed, right after the change of the IsBusy property, the animation is still running and it seems impossible for the internal control to receive focus. Please refer to the attached project which features a workaround using an attached property bound to the IsBusyIndicationVisible property of the RadBusyIndicator. Since it is updated later than the IsBusy property, the focus is correctly set to the inside element. 

    Hope this will be of use. We will be glad to assist you further.

    All the best,
    Teodor
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  5. Alexander
    Alexander avatar
    6 posts
    Member since:
    Aug 2010

    Posted 20 Aug 2010 Link to this post

    Hi Teodor...
    thank you very much, your solution works perfect !!!
    and thank you for the quick response... :D

    (this thread is closed - for me)
  6. Nick
    Nick avatar
    19 posts
    Member since:
    Aug 2010

    Posted 26 Aug 2010 Link to this post

    I noticed the same problem with the Disabled look and feel when setting IsBussy from _Loaded...

    The standard Silverlight Client Window doens't have an Opened event.. is there a way to make this work like it should without changing to a RadWindow?
  7. Alexander
    Alexander avatar
    6 posts
    Member since:
    Aug 2010

    Posted 27 Aug 2010 Link to this post

    Hi Nick...

    maybe you can try to inherit and override the OnOpernd method when you make your own ChildWindow...
    and then you can handle your code directly inside the OnOpened method or you can distribute you own Opend event there to consume it from other places outside you class/control...
    public partial class MyWindow : ChildWindow
    {
        protected override void OnOpened()
        {
            base.OnOpened();
            // fire your own Opened event
            RaiseOpened();
            // handle your code direct here
            xyz();
        }
     
        #region my opened event
        public event RoutedEventHandler Opened;
        private void RaiseOpened()
        {
            RoutedEventHandler handler = Opened;
            if(handler != null)
                handler(this, new RoutedEventArgs());
        }
        #endregion
     
        #region my direct busyIndicator handler
        private void xyz()
        {
            MyWebServiceClient client = new MyWebServiceClient();
            client.MyMethodCompleted += (sender, e) =>
            {
                // here the called method of WebService is finished
                busyIndicator.IsBusy = false;
                ...
            };
            busyIndicator.IsBusy = true;
            // calling the WebService method
            client.MyMethodAsync();
        }
        #endregion
    }

  8. Nick
    Nick avatar
    19 posts
    Member since:
    Aug 2010

    Posted 27 Aug 2010 Link to this post

    Thanks; I forgot to check if there was an event I could override... I did the following:
    protected override void OnOpened()
    {
        base.OnOpened();
        this.IsLoading = true;
    }
    Which works fine; I just need it in one window, not all of my Child windows :)

    Thanks m8.
  9. Nick
    Nick avatar
    19 posts
    Member since:
    Aug 2010

    Posted 27 Aug 2010 Link to this post

    Maybe you know this aswel...

    I've ran into a problem where a specific style prevents the OnOpened override to fire... (http://forums.silverlight.net/forums/p/198353/462200.aspx#462200)

    Any thoughts?

    [Update]
    Fixed. Problem was a Nesting Issue; VisualStateManager inside of a Canvas prevented the OnOpened even to fire. Changing te nesting fixed it.
    [/Update]
  10. Teodor
    Admin
    Teodor avatar
    501 posts

    Posted 01 Sep 2010 Link to this post

    Hi Nick,

    We are glad you have found a solution to your issue. 

    Feel free to further share your experience with our controls.

    All the best,
    Teodor
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top
DevCraft banner