This question is locked. New answers and comments are not allowed.
Hello, I'm having a problem with this control. I have to navigate between a few pages that have a DataBoundListBox inside them, I have set the NavigationCacheMode to enabled, and sometimes I navigate between different instances of the same page.
Everything runs fine, but sometimes the app crashes when I navigate BACK from another page.
This is my XAML setup:
The Source gets updated inside the OnNavigatedTo event: I create a new ObservableCollection and assign it to the previous Source in my ViewModel.
This is the StackTrace:
Since I don't see anything related to my code over there I'm not sure the crash depends on my methods, do you know why does that happen?
I noticed that this only seems to happen when navigating back.
Thank you for your help!
Sergio
Everything runs fine, but sometimes the app crashes when I navigate BACK from another page.
This is my XAML setup:
<
Primitives:RadDataBoundListBox
x:Name
=
"listBox"
ItemsSource
=
"{Binding Source}"
ItemTap
=
"listBox_ItemTap"
Tapped
=
"listBox_Tapped"
ItemTemplate
=
"{StaticResource ListBoxItemTemplate}"
ItemReorderStateChanged
=
"listBox_ItemReorderStateChanged"
Style
=
"{StaticResource AnimatedDataBoundListBox}"
/>
<!--Style for the RadDataBoundListBox-->
<
Style
TargetType
=
"Primitives:RadDataBoundListBox"
x:Key
=
"AnimatedDataBoundListBox"
>
<
Setter
Property
=
"ItemAnimationMode"
Value
=
"PlayAll"
/>
<
Setter
Property
=
"ItemAddedAnimationInterval"
Value
=
"0:0:0.05"
/>
<
Setter
Property
=
"ItemRemovedAnimationInterval"
Value
=
"0:0:0.05"
/>
<
Setter
Property
=
"IsItemReorderEnabled"
Value
=
"False"
/>
<
Setter
Property
=
"ItemAddedAnimation"
>
<
Setter.Value
>
<
telerikCore:RadPlaneProjectionAnimation
StartAngleX
=
"90"
StartAngleY
=
"-50"
StartAngleZ
=
"10"
Direction
=
"CounterClockwise"
Axes
=
"All"
EndAngleX
=
"0"
EndAngleY
=
"0"
EndAngleZ
=
"0"
>
<
telerikCore:RadPlaneProjectionAnimation.Easing
>
<
CircleEase
EasingMode
=
"EaseOut"
/>
</
telerikCore:RadPlaneProjectionAnimation.Easing
>
</
telerikCore:RadPlaneProjectionAnimation
>
</
Setter.Value
>
</
Setter
>
<
Setter
Property
=
"ItemRemovedAnimation"
>
<
Setter.Value
>
<
telerikCore:RadPlaneProjectionAnimation
StartAngleX
=
"0"
StartAngleY
=
"0"
StartAngleZ
=
"0"
Direction
=
"Clockwise"
Axes
=
"X"
EndAngleX
=
"-90"
Duration
=
"0:0:0.1"
/>
</
Setter.Value
>
</
Setter
>
<
Setter
Property
=
"ListHeaderTemplate"
>
<
Setter.Value
>
<
DataTemplate
>
<
Grid
Height
=
"55"
/>
</
DataTemplate
>
</
Setter.Value
>
</
Setter
>
</
Style
>
<!--Item template-->
<
DataTemplate
x:Key
=
"ListBoxItemTemplate"
>
<
ContentControl
Holding
=
"ContentControl_Holding"
>
<
Grid
>
<
Grid.ColumnDefinitions
>
<
ColumnDefinition
Width
=
"0.2*"
/>
<
ColumnDefinition
Width
=
"*"
/>
</
Grid.ColumnDefinitions
>
<
Grid
Margin
=
"10,10,0,10"
MinHeight
=
"55"
MinWidth
=
"55"
VerticalAlignment
=
"Center"
>
<
Canvas
Background
=
"{StaticResource PhoneAccentBrush}"
/>
<
Image
Source
=
"{Binding IconImage}"
Margin
=
"7"
/>
</
Grid
>
<
StackPanel
Grid.Column
=
"1"
Margin
=
"15,0,0,0"
>
<
TextBlock
Text
=
"{Binding Name}"
VerticalAlignment
=
"Center"
Foreground
=
"White"
FontSize
=
"25"
FontWeight
=
"SemiLight"
/>
<
TextBlock
Text
=
"{Binding FolderContent, Converter={StaticResource FolderConverter}}"
VerticalAlignment
=
"Center"
Foreground
=
"#FFA0A0A0"
FontSize
=
"16"
FontWeight
=
"SemiLight"
/>
<
TextBlock
Text
=
"{Binding GroupName}"
Visibility
=
"{Binding GroupName, Converter={StaticResource StringToVisibility}}"
Foreground
=
"#707070"
FontSize
=
"16"
/>
</
StackPanel
>
</
Grid
>
</
ContentControl
>
</
DataTemplate
>
The Source gets updated inside the OnNavigatedTo event: I create a new ObservableCollection and assign it to the previous Source in my ViewModel.
This is the StackTrace:
Exception: Object reference not set to an instance of an object.
StackTrace:
at Telerik.UI.Xaml.Controls.Primitives.RadVirtualizingDataControl.OnItemRemovedAnimationEnded(RadAnimation animation, SingleItemAnimationContext context)
at Telerik.UI.Xaml.Controls.Primitives.RadDataBoundListBox.OnItemRemovedAnimationEnded(RadAnimation animation, SingleItemAnimationContext context)
at Telerik.UI.Xaml.Controls.Primitives.RadVirtualizingDataControl.OnItemRemovedAnimation_Ended(Object sender, AnimationEndedEventArgs e)
at System.EventHandler`1.Invoke(Object sender, TEventArgs e)
at Telerik.Core.RadAnimation.OnEnded(PlayAnimationInfo info)
at Telerik.Core.RadAnimation.OnStopped(PlayAnimationInfo info)
at Telerik.Core.RadAnimationManager.StopStoryboard(PlayAnimationInfo info)
at Telerik.Core.RadAnimationManager.OnStoryboardCompleted(Object sender, Object e)
Since I don't see anything related to my code over there I'm not sure the crash depends on my methods, do you know why does that happen?
I noticed that this only seems to happen when navigating back.
Thank you for your help!
Sergio