how to determine which window is active?

8 posts, 0 answers
  1. Michael Chong
    Michael Chong avatar
    18 posts
    Member since:
    Jul 2009

    Posted 20 Jul 2009 Link to this post

    I'm a new registered user and sorry to ask again if anyone has raised this issue before.

    If I have multiple RadWindow are currently showing, how do I know which the one is active or which one is the top most?
    Any event or property that I can get its value to determine whether the window is active?

    What is the latest release version of RadControl for Silverlight? Is it the latest release version is compatible with Silverlight 3?

    Thanks for any help and information.
  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 22 Jul 2009 Link to this post

    Hello Michael,

    You can find out is a RadWindow instance is currently active by using its IsActiveWindow property. Unfortunately there is no event that notifies for its change, but when the active window is change the newly activated one gets the keyboard focus, so you could listen for the GotFocus event of the Window control.

    Hope this helps.

    The latest release (version 2009.2.701) has two different packages - one for Silverlight 2 and one for Silverlight 3. The only thing you should be aware of is that the Silverlight 3 version of the controls is not official yet and we understand that there are still some compatibility issues.

    Greetings,
    Miroslav Nedyalkov
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  3. DevCraft banner
  4. Michael Chong
    Michael Chong avatar
    18 posts
    Member since:
    Jul 2009

    Posted 22 Jul 2009 Link to this post

    Firstly, thanks for your information.

    I'm currently developing an application where a set of controls is shared by multiple RadWindow in which the only active RadWindow can manipulate them. I really hope that you can include some kind of "active event" for RadWindow in order that I can set my controls attach to which RadWindow is currently firing this event. Otherwise I will have to loop through each showing RadWindow to check which is the active one. I also feel that it may be unwise to use GotFocus event to set my controls attach to the Focused RadWIndow because I noticed that the event is firing frequently (going Focus/Lost Focus many time unexplained) and it wil be a heavy processing for my application. I hope you may take this into consideration for the next build.

    For the latest release (version 2009.2.701) Silverlight 3 version I still encounter the known issue of RadWindow moving out of control.
    Do the latest release (version 2009.2.701) has actually look into this problem and fix it? If not, will it be fixed on the next build or official release? When will be the official release of RadControl for Silverlight 3?

    Looking forward to hear from you.
    Thanks.
  5. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 23 Jul 2009 Link to this post

    Hello Michael,

    What I suggested wasn't to just to use the GotFocus event to do the job every time the event is fired, but when it is called to check if the window is currently active or not. We definitely should add such an event, but I think is ok for now to use something like this:
    private void OnGotFocus(object sender, RoutedEventArgs e) 
        var window = sender as RadWindow; 
        if (window != null && window.IsActiveWindow) 
        { 
            // Do your work here. 
        } 

    Could you please give us some more information about this "RadWindow moving out of control" issue. If it is not fixed yet, we will add it to our TODO list.

    The Silverlight 3 controls will be official with SP1 - it will be released in August.

    Regards,
    Miroslav Nedyalkov
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
  6. Michael Chong
    Michael Chong avatar
    18 posts
    Member since:
    Jul 2009

    Posted 23 Jul 2009 Link to this post

    Sorry to misinform about the issue of RadWindow out of control in the latest build.

    It is the binaries of "RadControls_for_Silverlight3_2009_2_720_dev" will do the trick. I replace those binaries into the installation folder of the latest release "RadControls_for_Silverlight_2009_2_701_DEV". The problem has been solved for the RadWindow in Silverlight 3, apparently. What left to know is the date for the official release of RadControls for Silverlight 3 and I hope it can be finalized as soon as possible.

    Thank you.
  7. Michael Chong
    Michael Chong avatar
    18 posts
    Member since:
    Jul 2009

    Posted 23 Jul 2009 Link to this post

    It is a good solution. Thanks for your professional help.
  8. Michael Chong
    Michael Chong avatar
    18 posts
    Member since:
    Jul 2009

    Posted 23 Jul 2009 Link to this post

    I have tested your code but it has the same processing issue that I mentioned before.
    I would like to share you for my testing result:

    void window_GotFocus(object sender, RoutedEventArgs e)  
            {  
                var window = sender as RadWindow;  
                if (window != null && window.IsActiveWindow)  
                {  
                    System.Diagnostics.Debug.WriteLine(System.Convert.ToString(window.Header));  
                }    
            } 

    the result will be some kind like this when i click on each window's header (to active a window):
    2
    2
    2
    1
    1
    1
    3
    3
    3

    The showing number is the window's ID.

    It is obviously not an ideal solution but I may considering to use some controling variable or property to minimize this overhead for the moment.
  9. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 24 Jul 2009 Link to this post

    Hello Michael Chong,

    Now I see. We will address this problem, but I cannot give you any time frame yet. We definitely will think about adding such an event.

    Regards,
    Miroslav Nedyalkov
    the Telerik team

    Instantly find answers to your questions on the newTelerik Support Portal.
    Check out the tipsfor optimizing your support resource searches.
Back to Top
DevCraft banner