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

Value cannot be infinite or NaN, JumpList with Panorama project

3 Answers 84 Views
JumpList
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
EFREN
Top achievements
Rank 1
EFREN asked on 04 Mar 2011, 05:37 AM
I use the JumpList control with Windows Phone Panorama Application project template in VS 2010, when I add the JumpList to render de sample data from MainViewModel a exception is raising "Value cannot be infinite or NaN. Parameter name: System.Windows.CustomDependencyProperty"

To reproduce only create a "Windows Phone Panorama Application" template and add JumpList to second panorama tab with ItemSource property to "Items"

Telerik Controls to Windows Phone 7 are download from your post: "RadJumpList Introduction and simple usage"
http://blogs.telerik.com/valentinstoychev/posts/11-02-09/radjumplist_for_wp7_part_i_-_introduction_and_simple_usage.aspx

I have Windows Phone Developer Tools January 2011 Update release with copy and paste functionality

My xaml

 

 

 

<phone:PhoneApplicationPage x:Class="TestControls.MainPage"

 

 

xmlns ="http://schemas.microsoft.com/winfx/2006/xaml/presentation"

 

xmlns:x ="http://schemas.microsoft.com/winfx/2006/xaml"

 

xmlns:phone ="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"

 

xmlns:shell ="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"

 

xmlns:controls ="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls"

 

xmlns:d ="http://schemas.microsoft.com/expression/blend/2008"

 

xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"

 

xmlns:telerikData ="clr-namespace:Telerik.Windows.Data;assembly=Telerik.Windows.Data"

 

xmlns:telerikDataControls ="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Data"

 

xmlns:telerikPrimitives ="clr-namespace:Telerik.Windows.Controls;assembly=Telerik.Windows.Controls.Primitives"

 

mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="800"

 

d:DataContext="{d:DesignData SampleData/MainViewModelSampleData.xaml}"

 

FontFamily="{StaticResource PhoneFontFamilyNormal}"

 

FontSize="{StaticResource PhoneFontSizeNormal}"

 

Foreground="{StaticResource PhoneForegroundBrush}"

 

SupportedOrientations="Portrait" Orientation="Portrait"

 

shell:SystemTray.IsVisible ="False">

 

<!--LayoutRoot is the root grid where all page content is placed-->

 

<Grid x:Name="LayoutRoot" Background ="Transparent">

 

<Grid.Resources>

 

<Style TargetType="telerikPrimitives:RadDataBoundListBoxItem" x:Key="ItemContainerStyle">

 

<Setter Property="HorizontalContentAlignment" Value ="Stretch"/>

 

</Style>

 

<DataTemplate x:Name ="JumpListItemTemplate">

 

<Grid Margin ="0, 10, 0, 8">

 

<Grid.ColumnDefinitions >

 

<ColumnDefinition Width ="Auto"/>

 

<ColumnDefinition Width ="*"/>

 

</Grid.ColumnDefinitions >

 

<!--<Image Source="{Binding Bitmap}" Grid.Row="0" Stretch="None" HorizontalAlignment="Left" VerticalAlignment="Top"/>-->

 

<Grid Grid.Column="1" Margin ="15, 0, 0, 0">

 

<Grid.RowDefinitions>

 

<RowDefinition Height ="Auto"/>

 

<RowDefinition Height ="Auto"/>

 

</Grid.RowDefinitions >

 

<TextBlock Text="{Binding RouteNumber}" FontSize="16" FontWeight="Bold" Grid.Row="0" TextWrapping

="Wrap"/>

 

<StackPanel Orientation="Horizontal" Grid.Row ="1">

 

<Image Source="Images/star.png" HorizontalAlignment="Center" VerticalAlignment ="Center"/>

 

<TextBlock Text="{Binding LineTwo}" FontSize="15" VerticalAlignment="Center" FontWeight="SemiBold" Margin="8, 0, 8, 0" Foreground ="#0795B9"/>

 

<Border BorderThickness="1" Background="Transparent" BorderBrush="{StaticResource PhoneSubtleBrush}" Margin="0, 3, 0, 3" Padding ="2, 1, 2, 1">

 

<TextBlock HorizontalAlignment="Center" VerticalAlignment="Center" Text="{Binding LineThree}" Foreground="{StaticResource PhoneSubtleBrush}" FontFamily="Georgia" FontWeight="Bold" FontSize

="14"/>

 

</Border>

 

</StackPanel>

 

</Grid>

 

</Grid>

 

</DataTemplate>

 

</Grid.Resources>

 

<!--Panorama control-->

 

<controls:Panorama Title ="my application">

 

<controls:Panorama.Background>

 

<ImageBrush ImageSource ="PanoramaBackground.png"/>

 

</controls:Panorama.Background >

 

<!--Panorama item one-->

 

<controls:PanoramaItem Header ="first item">

 

<!--Double line list with text wrapping-->

 

<ListBox Margin="0,0,-12,0" ItemsSource="{Binding Items}">

 

<ListBox.ItemTemplate>

 

<DataTemplate>

 

<StackPanel Margin="0,0,0,17" Width ="432">

 

<TextBlock Text="{Binding LineOne}" TextWrapping="Wrap" Style="{StaticResource PhoneTextExtraLargeStyle

}"/>

 

<TextBlock Text="{Binding LineTwo}" TextWrapping="Wrap" Margin="12,-6,12,0" Style="{StaticResource PhoneTextSubtleStyle}"/>

 

</StackPanel>

 

</DataTemplate>

 

</ListBox.ItemTemplate>

 

</ListBox>

 

</controls:PanoramaItem>

 

<!--Panorama item two-->

 

<controls:PanoramaItem Header ="second item">

 

<StackPanel Orientation ="Vertical">

 

<telerikDataControls:RadJumpList 

 

ItemTemplate="{StaticResource JumpListItemTemplate}"

 

ItemsSource="{Binding Items}"

 

ItemContainerStyle="{StaticResource ItemContainerStyle}" >

 

<!-- Group by LineOne -->

 

<telerikDataControls:RadJumpList.GroupDescriptors>

 

<telerikData:PropertyGroupDescriptor PropertyName="LineOne"/>

 

</telerikDataControls:RadJumpList.GroupDescriptors>

 

<!-- Sort by LineTwo -->

 

<telerikDataControls:RadJumpList.SortDescriptors>

 

<telerikData:PropertySortDescriptor PropertyName ="LineTwo"/>

 

</telerikDataControls:RadJumpList.SortDescriptors>

 

</telerikDataControls:RadJumpList>

 

</StackPanel>

 

</controls:PanoramaItem>

 

</controls:Panorama>

 

</Grid>

 

<!--Panorama-based applications should not show an ApplicationBar-->

 

</phone:PhoneApplicationPage>

 

 

 

 

StackTrace property is "   at System.Windows.Controls.Primitives.RangeBase.OnMaximumPropertyChanged(DependencyObject d, DependencyPropertyChangedEventArgs e)
   at System.Windows.DependencyObject.RaisePropertyChangeNotifications(DependencyProperty dp, Object newValue, Object oldValue)
   at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value, Boolean allowReadOnlySet, Boolean isSetByStyle, Boolean isSetByBuiltInStyle, PropertyInvalidationReason reason)
   at System.Windows.DependencyObject.SetValueInternal(DependencyProperty dp, Object value)
   at System.Windows.DependencyObject.SetValue(DependencyProperty property, Double d)
   at System.Windows.Controls.Primitives.RangeBase.set_Maximum(Double value)
   at Telerik.Windows.Controls.RadVirtualizingDataControl.UpdateScrollParams()
   at Telerik.Windows.Controls.RadVirtualizingDataControl.BalanceVisualSpace()
   at Telerik.Windows.Controls.RadVirtualizingDataControl.OnCollectionReset()
   at Telerik.Windows.Controls.RadVirtualizingDataControl.OnItemsChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Controls.RadDataBoundListBox.OnItemsChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Controls.RadVirtualizingDataControl.OnListSource_CollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.RadListSource.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.RadListSource.RefreshOverride()
   at Telerik.Windows.Data.RadCollectionViewSource.RefreshOverride()
   at Telerik.Windows.Data.RadListSource.Refresh()
   at Telerik.Windows.Data.RadCollectionViewSource.SourceCollectionChangedOverride(NotifyCollectionChangedEventArgs e)
   at Telerik.Windows.Data.RadListSource.OnSourceCollectionChanged(Object sender, NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.OnCollectionChanged(NotifyCollectionChangedEventArgs e)
   at System.Collections.ObjectModel.ObservableCollection`1.InsertItem(Int32 index, ItemViewModel item)
   at System.Collections.ObjectModel.Collection`1.Add(ItemViewModel item)
   at TestControls.MainViewModel.LoadData()
   at TestControls.MainPage.MainPage_Loaded(Object sender, RoutedEventArgs 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)"

3 Answers, 1 is accepted

Sort by
0
Deyan
Telerik team
answered on 07 Mar 2011, 10:22 AM
Hello EFREN,

Thanks for contacting us and for reporting this issue.

We have tried to reproduce the case by using the steps that you provided but did not manage to reproduce the exception by using the Beta 2 assemblies. Could you please make sure that you are using RadControls for Windows Phone 7 Beta 2? We have introduced a fix for a similar problem in this version and therefore we would like to make sure in which version does the issue occur so that we perform additional investigations.

It would be extremely helpful if you manage to provide us with a demo application that we can use to reproduce the case. This will help us isolate the problem and provide a fix for it.

Please note that you will have to open a new support ticket in order to be able to upload the demo project.

Thanks for your time and do not hesitate to get back to us in case you have further questions or need assistance.

Greetings,
Deyan
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
0
EFREN
Top achievements
Rank 1
answered on 08 Mar 2011, 05:55 PM
You are right, Beta 2 solve the problem, but with this release I have other problem, when add a RadJumpList into a Panorama, RadJumpList doesn´t fit height area, always I need set Height property manually, with set Height property manually in my RadJumpList solve the problem.
0
Deyan
Telerik team
answered on 09 Mar 2011, 08:49 AM
Hi EFREN,

Thanks for getting back to us.

Based on the XAML snippet that you sent me earlier I can assume that the RadJumpList control does not stretch to the height of the panorama item because it is put in a vertical StackPanel. The StackPanel measures its children with infinite space based on its orientation. Since the RadJumpList cannot give an exact height when put in a vertical StackPanel, it returns its minimum height which is 100 pixels. This is an expected behavior and is not a bug.

If you wish the RadJumpList to stretch in the panorama item make it a direct child of the panorama item instead of using a StackPanel.

I hope this helps.

Do not hesitate to get back to me in case of further questions.

Regards,
Deyan
the Telerik team
Let us know about your Windows Phone 7 application built with RadControls and we will help you promote it. Learn more>>
Tags
JumpList
Asked by
EFREN
Top achievements
Rank 1
Answers by
Deyan
Telerik team
EFREN
Top achievements
Rank 1
Share this question
or