RadWindow maximize and RestrictedAreaMargin bug?

4 posts, 0 answers
  1. Manuel Felício
    Manuel Felício avatar
    64 posts
    Member since:
    Oct 2009

    Posted 09 Jul 2010 Link to this post

    Hi,

    When I create windows I'm restricting their position so that the window never gets too far off the browser. I'm allowing it to move up to 75% of its size, except the top that is 0.

    Code below:

    double width = window.MinWidth == 0 || window.MinWidth == double.NaN ?
                        (window.Width == 0 || window.Width == double.NaN ? window.Width : window.MaxWidth) : window.MinWidth;
                double height = window.MinHeight == 0 || window.MinHeight == double.NaN ?
                    (window.Height == 0 || window.Height == double.NaN ? window.Height : window.MaxHeight) : window.MinHeight;
      
                window.RestrictedAreaMargin = new Thickness(-width * RestrictedWidthFactor, 0, -width * RestrictedWidthFactor, -height * RestrictedHeightFactor);
                window.IsRestricted = true;

    RestrictedWidthFactor = 0.75 and RestrictedHeightFactor = 0.75. Usually the Thickness object ends up with -8xx, 0, -8xx, -5xx.
    When I maximize the window the Left position stays at -8xx instead of 0, so the window appears almost half off the screen and because it is maximized we cannot move it. Am I doing something wrong? To fix the issue I register for the WindowStateChanged event and when Maximized I set the Left property to 0 and it works fine. 

    Best regards,

    Manuel Felício.

  2. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 13 Jul 2010 Link to this post

    Hi Manuel,

     The RadWindow control uses the RestrictedAreaMargin property to determine its maximized state size and position, so the negative values of your restricted area margins cause this problem. The work-around you use is exactly what I was about to suggest you.

    Greetings,
    Miroslav Nedyalkov
    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
  3. DevCraft banner
  4. Muhammad
    Muhammad avatar
    24 posts
    Member since:
    Mar 2012

    Posted 29 Oct 2012 Link to this post

    my radwindow is restricted and topmargin=45.but when i do maximize it does not leave the margin from top which is 45
  5. Miroslav Nedyalkov
    Admin
    Miroslav Nedyalkov avatar
    1718 posts

    Posted 31 Oct 2012 Link to this post

    Hello Muhammad,

    This behavior of the RadWindow control was changed as it was considered not correct. We have an item in PITS for adding a property for switching between the two modes, but it is not scheduled yet. You could vote for it if you need this behavior.

    Regards,
    Miroslav Nedyalkov
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top