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

Design-time issue: Object reference not set to an instance of an object.

1 Answer 140 Views
Cube
This is a migrated thread and some comments may be shown as answers.
Paul
Top achievements
Rank 1
Paul asked on 17 Aug 2009, 07:01 PM
I'm using SL Q2 2009 + the first beta version right after that.
I've placed two items into the radCube, both are Grids.  I've populated both with additional child items.  But I get the following issue during design-time under Expression 3:
------------------------------------------------------------------------------
XamlParseException: [Line: 0 Position: 0]
  --- Inner Exception ---
Object reference not set to an instance of an object.

StackTrace
at Telerik.Windows.Controls.RadCube.RenderFaces()
at Telerik.Windows.Controls.RadCube.RotateCube(Point3D verticalAxis, Double angle)
at Telerik.Windows.Controls.RadCube.OnApplyTemplate()
at System.Windows.FrameworkElement.OnApplyTemplate(IntPtr nativeTarget)
------------------------------------------------------------------------------
I noticed in the radCube properties that when this issue happens, the following brush properties are reset to NoBrush
  • Side2Background
  • Side3Background
  • Side3Background
  • Side4Background
  • Side5Background
  • Side6Background

If I manually set the brushes on each of these to a color, then the problem is cleared until sometime later -- after editing the Xaml.

Here's the Xaml for the radCube at the time of the error (it's inside a normal Grid):
------------------------------------------------------------------------------

 

 

<telerikNavigation:RadCube x:Name="radCubeMyWork" SelectedIndex="0" IsRotateOnStart="False" IsRotateYAxisOnly="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Side1Background="#FFF0F1CE" IsRotateOnClickEnabled="False">

 

 

<Grid x:Name="grdMyWork0">

 

<Grid.RowDefinitions>

 

 

 

 

<RowDefinition MinHeight="50"/>

 

</Grid.RowDefinitions>

 

 

<Grid.ColumnDefinitions>

 

 

<ColumnDefinition Width="0.9*"/>

 

 

<ColumnDefinition Width="24"/>

 

 

</Grid.ColumnDefinitions>

 

 

<telerikGridView:RadGridView x:Name="gvMyWork" Grid.Column="0" FontFamily="Fonts/SketchFlow Print.ttf#SketchFlow Print" d:LayoutOverrides="GridBox" ShowColumnHeaders="True" ShowGroupPanel="True" CanUserInsertRows="False" UseAlternateRowStyle="True" d:DataContext="{Binding}" ItemsSource="{Binding}" ScrollViewer.VerticalScrollBarVisibility="Visible" ScrollViewer.HorizontalScrollBarVisibility="Visible" IsReadOnly="True" AutoGenerateColumns="True" Margin="0"/>

 

 

<Button x:Name="cmdMyWorkSettings" Grid.Column="1" FontFamily="Webdings" Height="24" Style="{StaticResource Button-Sketch}" Width="24" RenderTransformOrigin="0.5,0.5" Content="@" ToolTipService.ToolTip="My Work Preferences" VerticalAlignment="Top" d:LayoutOverrides="VerticalMargin">

 

 

<Button.RenderTransform>

 

 

<TransformGroup>

 

 

<ScaleTransform/>

 

 

<SkewTransform/>

 

 

<RotateTransform Angle="0"/>

 

 

<TranslateTransform/>

 

 

</TransformGroup>

 

 

</Button.RenderTransform>

 

 

</Button>

 

 

<Button x:Name="cmdMyWorkHelp" Click="cmdSearchHelp_Click" Grid.Column="1" FontFamily="Webdings" Height="24" Style="{StaticResource Button-Sketch}" Width="24" RenderTransformOrigin="0.5,0.5" Content="s" ToolTipService.ToolTip="Help with My Work" Margin="0,24,0,0" VerticalAlignment="Top">

 

 

<Button.RenderTransform>

 

 

<TransformGroup>

 

 

<ScaleTransform/>

 

 

<SkewTransform/>

 

 

<RotateTransform Angle="0"/>

 

 

<TranslateTransform/>

 

 

</TransformGroup>

 

 

</Button.RenderTransform>

 

 

</Button>

 

 

<Button x:Name="cmdViewMyWorkDetails" Click="cmdViewMyWorkDetails_Click" Grid.Column="1" FontFamily="Webdings" Height="24" Style="{StaticResource Button-Sketch}" Width="24" RenderTransformOrigin="0.542,1.625" Content="L" ToolTipService.ToolTip="View Request Details" Margin="0,48,0,0" VerticalAlignment="Top">

 

 

<Button.RenderTransform>

 

 

<TransformGroup>

 

 

<ScaleTransform/>

 

 

<SkewTransform/>

 

 

<RotateTransform Angle="0"/>

 

 

<TranslateTransform/>

 

 

</TransformGroup>

 

 

</Button.RenderTransform>

 

 

</Button>

 

 

</Grid>

 

 

<Grid x:Name="grdMyWorkSettings">

 

 

<Grid.RowDefinitions>

 

 

<RowDefinition MinHeight="50"/>

 

 

</Grid.RowDefinitions>

 

 

<Grid.ColumnDefinitions>

 

 

<ColumnDefinition Width="0.9*"/>

 

 

<ColumnDefinition Width="24"/>

 

 

</Grid.ColumnDefinitions>

 

 

<Button x:Name="cmdMyWorkMain" Grid.Column="1" FontFamily="Webdings" Height="24" Style="{StaticResource Button-Sketch}" Width="24" RenderTransformOrigin="0.5,0.5" Content="@" ToolTipService.ToolTip="My Work Preferences" VerticalAlignment="Top" d:LayoutOverrides="VerticalMargin">

 

 

<Button.RenderTransform>

 

 

<TransformGroup>

 

 

<ScaleTransform/>

 

 

<SkewTransform/>

 

 

<RotateTransform Angle="0"/>

 

 

<TranslateTransform/>

 

 

</TransformGroup>

 

 

</Button.RenderTransform>

 

 

</Button>

 

 

</Grid>

 

 

</telerikNavigation:RadCube>

 

 

------------------------------------------------------------------------------
Is there a default values problem with radCube in design-time?

After manually setting the backgrounds, here's the radCube element:
------------------------------------------------------------------------------

 

 

 

<telerikNavigation:RadCube x:Name="radCubeMyWork" SelectedIndex="0" IsRotateOnStart="False" IsRotateYAxisOnly="True" HorizontalAlignment="Stretch" VerticalAlignment="Stretch" Side1Background="#FFF0F1CE" IsRotateOnClickEnabled="False" Side2Background="#FFCC9B9B" Side3Background="#FF9BA98B" Side4Background="#FF70AFA9" Side5Background="#FF706FBE" Side6Background="#FF852239">
------------------------------------------------------------------------------
This is not a show stopper issue, it builds and runs but it'd be nice to look at the next time you update the radCube design-time code.

Thanks,
Paul from Minneapolis

1 Answer, 1 is accepted

Sort by
0
Valentin.Stoychev
Telerik team
answered on 18 Aug 2009, 05:55 AM
Hello Paul,

Thank you for reporting this. We will try to provide a fix for this with the next internal build.

I added 1000 Telerik points to your account.

Greetings,
Valentin.Stoychev
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.
Tags
Cube
Asked by
Paul
Top achievements
Rank 1
Answers by
Valentin.Stoychev
Telerik team
Share this question
or