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

RadWindow maximize and RestrictedAreaMargin bug?

3 Answers 139 Views
Window
This is a migrated thread and some comments may be shown as answers.
Manuel Felício
Top achievements
Rank 1
Manuel Felício asked on 09 Jul 2010, 11:17 AM
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.

3 Answers, 1 is accepted

Sort by
0
Miroslav Nedyalkov
Telerik team
answered on 13 Jul 2010, 07:35 AM
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
0
Muhammad
Top achievements
Rank 1
answered on 29 Oct 2012, 04:01 PM
my radwindow is restricted and topmargin=45.but when i do maximize it does not leave the margin from top which is 45
0
Miroslav Nedyalkov
Telerik team
answered on 31 Oct 2012, 11:40 AM
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.

Tags
Window
Asked by
Manuel Felício
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Muhammad
Top achievements
Rank 1
Share this question
or