Problem creating class that inherits from RadPhoneApplicationFrame

4 posts, 0 answers
  1. Arash
    Arash avatar
    12 posts
    Member since:
    Aug 2011

    Posted 26 Aug 2012 Link to this post

    Just try it, it throws a nullreference on "base.ApplyTemplate()".

    Here is my control template:

    <Style TargetType="local:CustomFrame">
        <Setter Property="IsTabStop" Value="False"/>
        <Setter Property="Foreground" Value="{StaticResource PhoneForegroundBrush}"/>
        <Setter Property="FontSize" Value="{StaticResource PhoneFontSizeNormal}"/>
        <Setter Property="FontFamily" Value="{StaticResource PhoneFontFamilyNormal}"/>
        <Setter Property="HorizontalAlignment" Value="Stretch"/>
        <Setter Property="VerticalAlignment" Value="Stretch"/>
        <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
        <Setter Property="VerticalContentAlignment" Value="Stretch"/>
        <Setter Property="Background" Value="{x:Null}"/>
        <Setter Property="BorderThickness" Value="0"/>
        <Setter Property="BorderBrush" Value="{x:Null}"/>
        <Setter Property="Padding" Value="0"/>
        <Setter Property="Template">
            <Setter.Value>
                <ControlTemplate TargetType="local:CustomFrame">
                    <Border x:Name="ClientArea" BorderBrush="{TemplateBinding BorderBrush}" BorderThickness="{TemplateBinding BorderThickness}" Background="{TemplateBinding Background}" HorizontalAlignment="{TemplateBinding HorizontalAlignment}" VerticalAlignment="{TemplateBinding VerticalAlignment}" d:DesignHeight="800" d:DesignWidth="480" >
                        <Border.Resources>
                            <Storyboard x:Name="ShowLoadingSB">
                                <DoubleAnimation Duration="0" To="1" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LoadingOverlay"/>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="LoadingOverlay">
                                    <DiscreteObjectKeyFrame KeyTime="0">
                                        <DiscreteObjectKeyFrame.Value>
                                            <Visibility>Visible</Visibility>
                                        </DiscreteObjectKeyFrame.Value>
                                    </DiscreteObjectKeyFrame>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                            <Storyboard x:Name="HideLoadingSB">
                                <DoubleAnimation Duration="0:0:0.2" To="0" Storyboard.TargetProperty="(UIElement.Opacity)" Storyboard.TargetName="LoadingOverlay"/>
                                <ObjectAnimationUsingKeyFrames Storyboard.TargetProperty="(UIElement.Visibility)" Storyboard.TargetName="LoadingOverlay">
                                    <DiscreteObjectKeyFrame KeyTime="0:0:0.2">
                                        <DiscreteObjectKeyFrame.Value>
                                            <Visibility>Collapsed</Visibility>
                                        </DiscreteObjectKeyFrame.Value>
                                    </DiscreteObjectKeyFrame>
                                </ObjectAnimationUsingKeyFrames>
                            </Storyboard>
                        </Border.Resources>
                        <Grid>
                            <telerikPrimitives:RadTransitionControl x:Name="TransitionControl" HorizontalAlignment="{TemplateBinding HorizontalContentAlignment}" VerticalAlignment="{TemplateBinding VerticalContentAlignment}" Margin="{TemplateBinding Padding}" Content="{TemplateBinding Content}" ContentTemplate="{TemplateBinding ContentTemplate}" Transition="{TemplateBinding Transition}" />
                            <StackPanel x:Name="LoadingOverlay" IsHitTestVisible="False" VerticalAlignment="Center" Background="{StaticResource PhoneChromeBrush}">
                                <TextBlock TextWrapping="Wrap" Foreground="{StaticResource PanoramaForegroundBrush}" FontFamily="{StaticResource PhoneFontFamilyNormal}" HorizontalAlignment="Center" VerticalAlignment="Center" TextAlignment="Center" Margin="-3,24,0,0" Text="Loading news from memory" FontSize="{StaticResource PhoneFontSizeLarge}"/>
                                <sglib:RadialBusyIndicator x:Name="BusyIndicator" VerticalAlignment="Center" Foreground="{StaticResource PanoramaForegroundBrush}" Width="48" Height="48" Margin="0,12,0,24" NumberOfItems="7" IsPlaying="True"/>
                            </StackPanel>
                        </Grid>
                    </Border>
                </ControlTemplate>
            </Setter.Value>
        </Setter>
    </Style>
  2. Arash
    Arash avatar
    12 posts
    Member since:
    Aug 2011

    Posted 26 Aug 2012 Link to this post

    I'm using the Q2 release btw
  3. DevCraft banner
  4. Arash
    Arash avatar
    12 posts
    Member since:
    Aug 2011

    Posted 26 Aug 2012 Link to this post

    Alright found the answer, you have to set the Transition Property to some (any) Transition object.
  5. Valentin.Stoychev
    Admin
    Valentin.Stoychev avatar
    2198 posts

    Posted 27 Aug 2012 Link to this post

    Hello Arash,

    Please let us know if you need more help in achieving your scenario.

    Regards, Valentin.Stoychev
    the Telerik team

    Explore the entire Telerik portfolio by downloading Telerik DevCraft Ultimate.

Back to Top