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

RadWindow.RestrictedAreaMargin bug?

2 Answers 150 Views
Window
This is a migrated thread and some comments may be shown as answers.
Ivan Kopcanski
Top achievements
Rank 1
Ivan Kopcanski asked on 12 Oct 2009, 09:10 AM
Hi,

     I'm trying to use RadWindow.IsRestricted and RadWindow.RestrictedAreaMargin
properties to narrow the available space for dragging and dropping the window. 
I don't wish window lower and right hand edge to exit IE boundaries when dragging the window.
For some values for restricted area I'm getting good results but not good enough.

I wish to have RadWindow with size of 600 x 800 pxls and I want it to be draggable across the entire
control that is stretched vertically and horizontally to fully fit the maximized IE window.
For thickness object set to (left - 10, top-10, right-600, bottom-600) I can drag the window in very small area.

When this area becomes larger, e.g. (10, 10, 800, 800), the window is very strange and when I try to
maximize it to see it filling entire restricted area I get the exception pasted bellow. 
I created small project for reproducing this issue, hope it will help you to solve this, it is attached to this post.
Since you have supported types for attached files, i changed my zip archive file extension to .jpg,
so just rename it to the RadWindowMaximized.zip to get the archive. I hope the code is better than just a screenshot.

Thank you in advance.

"Value does not fall within the expected range."

at System.Windows.Rect.set_Height(Double value)\r\n   at Telerik.Windows.Controls.RadWindowStateManager.UpdateMaximize()\r\n   at Telerik.Windows.Controls.RadWindowStateManager.get_SizeAndPosition()\r\n   at Telerik.Windows.Controls.RadWindow.UpdateWindowState()\r\n   at Telerik.Windows.Controls.RadWindow.OnWindowStateChanged()\r\n   at Telerik.Windows.Controls.RadWindow.OnWindowStateChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)\r\n   at Telerik.Windows.PropertyMetadata.<>c__DisplayClass1.<Create>b__0(DependencyObject d, DependencyPropertyChangedEventArgs e)\r\n   at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object newValue, Object oldValue)\r\n   at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isSetByStyle, Boolean isSetByBuiltInStyle, PropertyInvalidationReason reason)\r\n   at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value)\r\n   at System.Windows.DependencyObject.SetValue(DependencyProperty dp, Object value)\r\n   at Telerik.Windows.Controls.RadWindow.set_WindowState(WindowState value)\r\n   at Telerik.Windows.Controls.RadWindow.OnTitleDoubleClick()\r\n   at Telerik.Windows.Controls.RadWindow.OnThumbDragStarted(Object sender, DragStartedEventArgs e)\r\n   at System.Windows.Controls.Primitives.Thumb.OnMouseLeftButtonDown(MouseButtonEventArgs e)\r\n   at System.Windows.Controls.Control.OnMouseLeftButtonDown(Control ctrl, EventArgs e)\r\n   at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)

2 Answers, 1 is accepted

Sort by
0
Accepted
Miroslav Nedyalkov
Telerik team
answered on 12 Oct 2009, 01:40 PM
Hi Ivan,

When you are sending sample projects please open support tickets instead of forum threads.

As the property is called this is the margin of the restricted area. That means that the restricted area 10, 10, 800, 800 is smaller than the restricted area 10, 10, 600, 600, as these are the distances from the end of the Silverlight plugin to the end of the restricted area. Please, find the attached image that explains the RestrictedAreaMarign property.

The exception is thrown, because the restricted area itself has negative width or height.

Best wishes,
Miroslav Nedyalkov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Watch a video on how to optimize your support resource searches and check out more tips on the blogs.
0
Ivan Kopcanski
Top achievements
Rank 1
answered on 12 Oct 2009, 02:03 PM
Thanks for the answer it works now. I was confused with 'Margin' suffix of the property figuring out what is the object the margin is set for? I was not thinking in the direction that it is the whole IE visible area that is dinamically changed by user ;)
Tags
Window
Asked by
Ivan Kopcanski
Top achievements
Rank 1
Answers by
Miroslav Nedyalkov
Telerik team
Ivan Kopcanski
Top achievements
Rank 1
Share this question
or