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

RadModalWindow

4 Answers 62 Views
Window
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Derek
Top achievements
Rank 1
Derek asked on 11 Nov 2011, 08:09 PM
edit: apparently I just needed to set the Background for the window.

Using SilverlightSpy I'm trying to figure out why creating a RadModalWindow programmaticly vs in xaml is causing problems.  I'm assume the missing Fill is the problem.  From another thread I've tried setting the PlacementTarget.  What sort of things should I be looking at that would cause the background items to not be disabled?
popup.PlacementTarget = Application.Current.RootVisual;

 created in xaml
(From SilverlightSpy)
<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
 <Rectangle Fill="#AA000000" Height="768" Stretch="Fill" Width="480" />
</Canvas>

created in code
(From SilverlightSpy)
<Canvas xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
 <Rectangle Height="768" Stretch="Fill" Width="480" />
</Canvas>

4 Answers, 1 is accepted

Sort by
0
Victor
Telerik team
answered on 14 Nov 2011, 11:09 AM
Hi Derek,

 Thank you for writing.
This happens because when you create an instance of RadWindow in code, it's default style is not applied. The reason for this is that the window object itself is never inserted in the Silverlight element tree, only its content. You have to set the background manually.

Please write again if you have other questions.

Kind regards,
Victor
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Derek
Top achievements
Rank 1
answered on 14 Nov 2011, 04:31 PM
Is there a way to apply the default style in code or is the background the only thing that is set?
0
Victor
Telerik team
answered on 14 Nov 2011, 05:16 PM
Hello Derek,

 As far as I know the default style can not be applied manually through code. You could extract the default style with the Reflector tool by opening the primitives assembly and browsing the assembly resources. In this case you can avoid doing that because the modal window style is very simple. Here is what is looks like:

<telerikCore:RadPlaneProjectionAnimation x:Key="RadWindow_DefaultOpenAnimation" Axes="X" StartAngleX="-90" EndAngleX="0" Duration="0:0:.2">
    <telerikCore:RadPlaneProjectionAnimation.Easing>
        <ExponentialEase Exponent="4" EasingMode="EaseOut"/>
    </telerikCore:RadPlaneProjectionAnimation.Easing>
</telerikCore:RadPlaneProjectionAnimation>
 
<telerikCore:RadPlaneProjectionAnimation x:Key="RadWindow_DefaultCloseAnimation" Axes="X" StartAngleX="0" EndAngleX="90" Duration="0:0:.2">
    <telerikCore:RadPlaneProjectionAnimation.Easing>
        <ExponentialEase Exponent="4" EasingMode="EaseIn"/>
    </telerikCore:RadPlaneProjectionAnimation.Easing>
</telerikCore:RadPlaneProjectionAnimation>
 
<Style TargetType="telerikPrimitives:RadModalWindow">
    <Setter Property="Background" Value="{StaticResource PhoneSemitransparentBrush}"/>
    <Setter Property="OpenAnimation" Value="{StaticResource RadWindow_DefaultOpenAnimation}"/>
    <Setter Property="CloseAnimation" Value="{StaticResource RadWindow_DefaultCloseAnimation}"/>
</Style>

Please write again if you need further assistance.

All the best,
Victor
the Telerik team

Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

0
Derek
Top achievements
Rank 1
answered on 14 Nov 2011, 05:24 PM
Ah, ok, thanks.
Tags
Window
Asked by
Derek
Top achievements
Rank 1
Answers by
Victor
Telerik team
Derek
Top achievements
Rank 1
Share this question
or