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

how to determine which window is active?

7 Answers 163 Views
Window
This is a migrated thread and some comments may be shown as answers.
Michael Chong
Top achievements
Rank 1
Michael Chong asked on 20 Jul 2009, 10:16 AM
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.

7 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 22 Jul 2009, 02:19 PM
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.
0
Michael Chong
Top achievements
Rank 1
answered on 23 Jul 2009, 03:05 AM
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.
0
Miroslav Nedyalkov
Telerik team
answered on 23 Jul 2009, 10:04 AM
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.
0
Michael Chong
Top achievements
Rank 1
answered on 23 Jul 2009, 10:38 AM
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.
0
Michael Chong
Top achievements
Rank 1
answered on 23 Jul 2009, 11:09 AM
It is a good solution. Thanks for your professional help.
0
Michael Chong
Top achievements
Rank 1
answered on 23 Jul 2009, 11:27 AM
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.
0
Miroslav Nedyalkov
Telerik team
answered on 24 Jul 2009, 07:34 AM
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.
Tags
Window
Asked by
Michael Chong
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Michael Chong
Top achievements
Rank 1
Share this question
or