RadModalWindow

5 posts, 0 answers
  1. Derek
    Derek avatar
    39 posts
    Member since:
    Aug 2012

    Posted 11 Nov 2011 Link to this post

    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>
  2. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 14 Nov 2011 Link to this post

    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 >>

  3. DevCraft banner
  4. Derek
    Derek avatar
    39 posts
    Member since:
    Aug 2012

    Posted 14 Nov 2011 Link to this post

    Is there a way to apply the default style in code or is the background the only thing that is set?
  5. Victor
    Admin
    Victor avatar
    1351 posts

    Posted 14 Nov 2011 Link to this post

    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 >>

  6. Derek
    Derek avatar
    39 posts
    Member since:
    Aug 2012

    Posted 14 Nov 2011 Link to this post

    Ah, ok, thanks.
Back to Top
DevCraft banner