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

Problem creating class that inherits from RadPhoneApplicationFrame

3 Answers 27 Views
PhoneApplicationFrame
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Arash
Top achievements
Rank 1
Arash asked on 27 Aug 2012, 12:15 AM
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>

3 Answers, 1 is accepted

Sort by
0
Arash
Top achievements
Rank 1
answered on 27 Aug 2012, 12:15 AM
I'm using the Q2 release btw
0
Arash
Top achievements
Rank 1
answered on 27 Aug 2012, 12:52 AM
Alright found the answer, you have to set the Transition Property to some (any) Transition object.
0
Valentin.Stoychev
Telerik team
answered on 27 Aug 2012, 06:10 AM
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.

Tags
PhoneApplicationFrame
Asked by
Arash
Top achievements
Rank 1
Answers by
Arash
Top achievements
Rank 1
Valentin.Stoychev
Telerik team
Share this question
or