How to obtain RadWindow that has focus by RadWindowManager

4 posts, 1 answers
  1. Dario Concilio
    Dario Concilio avatar
    129 posts
    Member since:
    Apr 2016

    Posted 11 Apr Link to this post

    Hi to all,

    how can I find a RadWindow that has focus?

    We have MainView that opens several RadWindow, but I need to know which is focused, because may have central command to operata on it.

    Can I use RadWindowManager?

    Everything else?

     
  2. Nasko
    Admin
    Nasko avatar
    588 posts

    Posted 12 Apr Link to this post

    Hi Potito,

    You could use the RadWindowManager to get the current RadWindow that is active. The manager provides GetWindows method that will return a list of all currently opened Windows and using for example Linq you could find the Window that is currently active:
    var activeWindow = RadWindowManager.Current.GetWindows().Where(a => a.IsActiveWindow).FirstOrDefault();

    Hope this helps.

    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
  4. Dario Concilio
    Dario Concilio avatar
    129 posts
    Member since:
    Apr 2016

    Posted 14 Apr in reply to Nasko Link to this post

    Thank you for support, I explain my environment.

    I'm developing an application that it has several usercontrol nested (like outlook) and other RadWindow, those RadWindows should be managed such a way as to have a single window activated that it will be linked to subset of RadMenu of the MainWindow.

    Then "When the RadWindow is activated, in the Main Window some (relative type) RadMenuItem are activated"

    How can I intercept when a RadWindow gets the activation?

  5. Answer
    Nasko
    Admin
    Nasko avatar
    588 posts

    Posted 14 Apr Link to this post

    Hello Potito,

    Form the provided description it seems you are looking for an approach for getting notified when RadWindow is activated. If that is the case you could handle to the Activated event of RadWindow. When the window gets activated the event will be fired and inside it you could implement your desired logic for activations of the MenuItems:
    window.Activated += window_Activated;
    ...
    void window_Activated(object sender, EventArgs e)
    {
        //when the window is a ctivated the event will fire and here you could implement your logic
    }

    We hope this will help 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.
Back to Top