Let a UserControl stay in front of all Windows

4 posts, 0 answers
  1. Christoph
    Christoph avatar
    2 posts
    Member since:
    Mar 2011

    Posted 20 Mar 2011 Link to this post

    Hi @ all,
    i am developing a UI that looks like the windows-os ui. For the windows i am using the telerik  controls. My problem is, that my TaksList-Control (a normal Silverlight-UserControl) is also covered by the telerik-windows, because the telerik-windows stay on top of all usercontrols. 

    My question is, if it is possible to let a control stay in top of the telerik-windows ?

    Thanks!
  2. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 24 Mar 2011 Link to this post

    Hello Christoph,

    You are right - RadWindow always stays on top of the other controls. I suggest to modify your TasksList user control to inherit RadWindow class as explained in this help article - in this way you can set it to be above the other window. Please try it and let us know how it goes.

    Best wishes,
    Yana
    the Telerik team
  3. DevCraft banner
  4. Christoph
    Christoph avatar
    2 posts
    Member since:
    Mar 2011

    Posted 05 Apr 2011 Link to this post

    Hello Yana,

    thank for your tip, but the problem is, that i have a lot of UIElements that must stay in front of all windows. It's not possible for me to implement them all as RadWindows. That would kill my visual application design.

    I've reflekted the code that's executed during opening a RadWindow and i found the part, that is responsible fot let the RadWindows stay in Front of all other UIElements.

    Here's the code:

    internal static void AttachPopupToVisualTree(Popup popup)
    {
        UIElement root = Application.Current.RootVisual;
        if (root != null)
        {
            Panel panel = root as Panel;
            if (panel == null)
            {
                int childrenCount = VisualTreeHelper.GetChildrenCount(root);
                for (int i = 0; i < childrenCount; i++)
                {
                    panel = VisualTreeHelper.GetChild(root, i) as Panel;
                    if (panel != null)
                    {
                        break;
                    }
                }
            }
            if ((panel != null) && (popup != null))
            {
                DependencyObject visualParent = VisualTreeHelper.GetParent(popup);
                DependencyObject logicalParent = popup.Parent;
                if ((visualParent == null) && (logicalParent == null))
                {
                    panel.Children.Insert(0, popup);
                    popup.UpdateLayout();
                }
            }
        }
    }
    
    
                


    You see, the problem is, that the Root-Panel for the RasWindows is autmaticaly set to the Application.Current.RootVisual (or the first Panel found in the visual-tree). 
    Ist it possible to set the Root-Panel for the RadWindows manualy?
    That would salve all my problems.

    Thnaks!
  5. Yana
    Admin
    Yana avatar
    4554 posts

    Posted 07 Apr 2011 Link to this post

    Hello Christoph,
     
    This behavior of RadWindow is by design and cannot be changed - the window acts as a popup, that's why it is always shown on top. We're sorry for the inconvenience.

    All the best,
    Yana
    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