Hello,
I have a user control:
Code behind of the user control:
I create a RadWindow and set its content with a new instance of my user control:
When I show the RadWindow, if I move the slider control to zoom the viewbox. I get the following error (See error.jpg):
Line: 56
Error: Unhandled Error in Silverlight Application
Code: 4008
Category: RuntimeError
Message: Layout cycle detected. Layout could not complete.
MethodName:
But if I resize the RadWindow first and then move the slider control, it works without any error.
Anything to work around this problem?
Thank you,
Michel
I have a user control:
<
Grid
x:Name
=
"LayoutRoot"
Background
=
"White"
>
<
telerik:RadDockPanel
LastChildFill
=
"True"
Background
=
"White"
>
<
telerikNavigation:RadToolBar
telerik:RadDockPanel.Dock
=
"Top"
telerik:DockingPanel.Dock
=
"Top"
>
<
telerikNavigation:RadToolBar.Items
>
<
Button
Name
=
"btnPrint"
Content
=
"Print"
/>
<
Button
Name
=
"btnPrevious"
Content
=
"Previous"
/>
<
Button
Name
=
"btnNext"
Content
=
"Next"
/>
<
Slider
Name
=
"uiZoomSlider"
Width
=
"100"
Minimum
=
"0.2"
Maximum
=
"10"
ValueChanged
=
"uiZoomSlider_ValueChanged"
Value
=
"1"
/>
</
telerikNavigation:RadToolBar.Items
>
</
telerikNavigation:RadToolBar
>
<
ScrollViewer
Name
=
"scvDocument"
HorizontalScrollBarVisibility
=
"Auto"
VerticalScrollBarVisibility
=
"Auto"
>
<
telerik:LayoutTransformControl
x:Name
=
"ltDocument"
>
<
telerik:LayoutTransformControl.LayoutTransform
>
<
ScaleTransform
x:Name
=
"Scale"
/>
</
telerik:LayoutTransformControl.LayoutTransform
>
<
Viewbox
Name
=
"vbDocument"
>
<
Border
Name
=
"DocumentContainer"
BorderBrush
=
"Gray"
BorderThickness
=
"1"
/>
</
Viewbox
>
</
telerik:LayoutTransformControl
>
</
ScrollViewer
>
</
telerik:RadDockPanel
>
</
Grid
>
Code behind of the user control:
private
void
uiZoomSlider_ValueChanged(
object
sender, RoutedPropertyChangedEventArgs<
double
> e)
{
if
(ltDocument !=
null
)
{
((ScaleTransform)ltDocument.LayoutTransform).ScaleX = e.NewValue;
((ScaleTransform)ltDocument.LayoutTransform).ScaleY = e.NewValue;
ltDocument.ApplyLayoutTransform();
}
}
I create a RadWindow and set its content with a new instance of my user control:
Telerik.Windows.Controls.RadWindow rw =
new
Telerik.Windows.Controls.RadWindow();
ucPrintPreview pp =
new
ucPrintPreview();
rw.Content = pp;
rw.CanClose =
true
;
rw.CanMove =
true
;
rw.IsRestricted =
true
;
rw.Header =
"Print Preview"
;
rw.WindowStartupLocation = Telerik.Windows.Controls.WindowStartupLocation.CenterOwner;
CoaPrintDocument cpd =
new
CoaPrintDocument();
cpd.Height = 1024;
cpd.Width = 748;
pp.DocumentContainer.Child = (UIElement)cpd;
rw.ShowDialog();
When I show the RadWindow, if I move the slider control to zoom the viewbox. I get the following error (See error.jpg):
Line: 56
Error: Unhandled Error in Silverlight Application
Code: 4008
Category: RuntimeError
Message: Layout cycle detected. Layout could not complete.
MethodName:
But if I resize the RadWindow first and then move the slider control, it works without any error.
Anything to work around this problem?
Thank you,
Michel