Error 2258 at run time setting label properties

3 posts, 1 answers
  1. SteveL
    SteveL avatar
    68 posts
    Member since:
    Apr 2009

    Posted 01 Jun 2009 Link to this post

    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)


    Here is the code for my gauge:

    <control:RadGauge x:Name="GustGauge" Width="200" Height="200" Margin="60,0,0,0"
            <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:TickProperties Length="0.08" TickWidth="0.2" Location="OverOutside" Background="White"/> 
                        <gauge:TickProperties Length="0.06" Location="OverOutside" Background="White"/> 
                    <!-- Set the properties for the scale labels --> 
                          <gauge:LabelProperties FontSize="10" Foreground="White"/> 
                        <gauge:Needle x:Name="gustneedle" IsAnimated="True" Duration="0:0:2" Style="{StaticResource BlueNeedleStyle}"/> 
                        <gauge:Marker x:Name="g_pointermax" 
                                TooltipFormat="Max today {0:F1}" 
                                Location="Outside" Style="{StaticResource MarkerStyleRed}"/> 
                        <gauge:Marker x:Name="g_pointer10min" 
                                RelativeHeight="0.06" TooltipFormat="10min max {0:F1}"  
                                Location="Outside" Style="{StaticResource MarkerStyleYellow}"/> 
                Background="{StaticResource Wind_Range}"  
                BorderBrush="{StaticResource Wind_Range}" /> 
                                    <RowDefinition Height="0.35*" /> 
                                    <RowDefinition Height="0.35*" /> 
                                    <RowDefinition Height="0.15*" /> 
                                    <RowDefinition Height="0.15*" /> 
                                <TextBlock Grid.Row="0" 
                                       FontFamily="Verdana"><Run Text="Wind Gust"/></TextBlock> 
                                <TextBlock Grid.Row="2" 
                                       FontFamily="Verdana"><Run Text="0.0"/></TextBlock> 
                                <TextBlock Grid.Row="3" 
                                       FontFamily="Verdana"><Run Text="mph"/></TextBlock> 

    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?


  2. Answer
    Andrey avatar
    1681 posts

    Posted 03 Jun 2009 Link to this post

    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:

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

    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.
  3. DevCraft banner
  4. SteveL
    SteveL avatar
    68 posts
    Member since:
    Apr 2009

    Posted 04 Jun 2009 Link to this post

    Thank you, Andrey, that seems to have fixed it.

Back to Top