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

Error 2258 at run time setting label properties

2 Answers 85 Views
Gauge
This is a migrated thread and some comments may be shown as answers.
SteveL
Top achievements
Rank 2
SteveL asked on 01 Jun 2009, 08:22 AM
Some of the users of the application I have created are getting an error at run time. The error goes away if they refresh the page! Not everyone gets the error - I can't reproduce it myself. The error is:

Message: Unhandled Error in Silverlight 2 Application 2258 An error has occurred. [Line: 868 Position: 85]
at System.Windows.Application.LoadComponent(Object component, Uri resourceLocator)
at CumulusRealtime.Page.InitializeComponent()
at CumulusRealtime.Page..ctor()
at CumulusRealtime.App.OnStartup(Object sender, StartupEventArgs e)
at System.Windows.CoreInvokeHandler.InvokeEventHandler(Int32 typeIndex, Delegate handlerDelegate, Object sender, Object args)
at MS.Internal.JoltHelper.FireEvent(IntPtr unmanagedObj, IntPtr unmanagedObjArgs, Int32 argsTypeIndex, String eventName)

Error 2258 is AG_E_PARSER_PROPERTY_NOT_FOUND.

Here is the code for my gauge:

<control:RadGauge x:Name="GustGauge" Width="200" Height="200" Margin="60,0,0,0"
    <Grid> 
        <gauge:RadialGauge x:Name="gustradialgauge" Style="{StaticResource BlueGaugeStyle}"
            <gauge:RadialScale x:Name="gustscale" StrokeThickness="2" StartWidth="0.0" EndWidth="0.0" StartAngle="120" SweepAngle="300" Min="0" Max="80" Radius="0.72" MajorTickStep="10" MiddleTicks="5"
                <gauge:RadialScale.MajorTick> 
                    <gauge:TickProperties Length="0.08" TickWidth="0.2" Location="OverOutside" Background="White"/> 
                </gauge:RadialScale.MajorTick> 
                <gauge:RadialScale.MiddleTick> 
                    <gauge:TickProperties Length="0.06" Location="OverOutside" Background="White"/> 
                </gauge:RadialScale.MiddleTick> 
                <!-- Set the properties for the scale labels --> 
                <gauge:RadialScale.Label> 
                      <gauge:LabelProperties FontSize="10" Foreground="White"/> 
                </gauge:RadialScale.Label> 
                <gauge:IndicatorList> 
                    <gauge:Needle x:Name="gustneedle" IsAnimated="True" Duration="0:0:2" Style="{StaticResource BlueNeedleStyle}"/> 
                    <gauge:Marker x:Name="g_pointermax" 
                            RelativeWidth="0.06" 
                            RelativeHeight="0.06"  
                            TooltipFormat="Max today {0:F1}" 
                            Location="Outside" Style="{StaticResource MarkerStyleRed}"/> 
                    <gauge:Marker x:Name="g_pointer10min" 
                            RelativeWidth="0.06" 
                            RelativeHeight="0.06" TooltipFormat="10min max {0:F1}"  
                            Location="Outside" Style="{StaticResource MarkerStyleYellow}"/> 
                </gauge:IndicatorList> 
                <gauge:RangeList> 
                    <gauge:RadialRange  
                        Offset="0.1"  
            x:Name="gustrange"  
            Min="60"  
            Max="80"  
            StartWidth="0.001"  
            EndWidth="0.05"  
            Location="Inside"  
            Background="{StaticResource Wind_Range}"  
            BorderBrush="{StaticResource Wind_Range}" /> 
                </gauge:RangeList> 
 
                            </gauge:RadialScale> 
                        </gauge:RadialGauge> 
                        <Grid> 
                            <Grid.RowDefinitions> 
                                <RowDefinition Height="0.35*" /> 
                                <RowDefinition Height="0.35*" /> 
                                <RowDefinition Height="0.15*" /> 
                                <RowDefinition Height="0.15*" /> 
                            </Grid.RowDefinitions> 
 
                            <TextBlock Grid.Row="0" 
                                   x:Name="gustlabel" 
                                   VerticalAlignment="Bottom" 
                                   HorizontalAlignment="Center" 
                                   Foreground="White" 
                                   FontFamily="Verdana"><Run Text="Wind Gust"/></TextBlock> 
                            <TextBlock Grid.Row="2" 
                                   x:Name="gustvaluelabel" 
                                   VerticalAlignment="Bottom" 
                                   HorizontalAlignment="Center" 
                                   Foreground="White" 
                                   FontFamily="Verdana"><Run Text="0.0"/></TextBlock> 
                            <TextBlock Grid.Row="3" 
                                   x:Name="gustunitlabel" 
                                   VerticalAlignment="Top" 
                                   HorizontalAlignment="Center" 
                                   Foreground="White" 
                                   FontFamily="Verdana"><Run Text="mph"/></TextBlock> 
        </Grid> 
    </Grid> 
</control:RadGauge> 

Sorry about the formatting, I found the formatter a bit hard to use.

The line that corresponds to 868 is:

<gauge:LabelProperties FontSize="10" Foreground="White"/>

Position 85 is the start of "White".

Could you tell me what I'm doing wrong, please?

Steve











2 Answers, 1 is accepted

Sort by
0
Accepted
Andrey
Telerik team
answered on 03 Jun 2009, 02:14 PM
Hi Steve,

We performed some research and we found that this can be reproduced in just a small number of the old style PCs with slow processors. During our test we were only able to reproduce it on a single machine. It looks like the source of the problem is in unavailability of the component resources at the moment when XAML is parsed. It seems that on the old style PCs theme loading is not completed at the moment when the XAML parsing is started. 
 
I would recommend that you add the following XAML into your page resources:

<ResourceDictionary> 
      <telerik:ResourceDictionary.MergedDictionaries> 
                  <telerik:ResourceDictionary Source="/Telerik.Windows.Controls.Gauge;component/Themes/Generic.xaml" /> 
      </telerik:ResourceDictionary.MergedDictionaries> 
</ResourceDictionary> 
 

This code will force the page to pre-load RadGauge control resources and make them available when the rest of the XAML is loaded. With this addition your code works fine on our PC where we were able to reproduce the problem. Hope this helps.

Sincerely yours,
Andrey Murzov
the Telerik team

Instantly find answers to your questions on the new Telerik Support Portal.
Check out the tips for optimizing your support resource searches.
0
SteveL
Top achievements
Rank 2
answered on 04 Jun 2009, 07:57 AM
Thank you, Andrey, that seems to have fixed it.

Steve
Tags
Gauge
Asked by
SteveL
Top achievements
Rank 2
Answers by
Andrey
Telerik team
SteveL
Top achievements
Rank 2
Share this question
or