The Author Online Book Forums are Moving

The Author Online Book Forums will soon redirect to Manning's liveBook and liveVideo. All book forum content will migrate to liveBook's discussion forum and all video forum content will migrate to liveVideo. Log in to liveBook or liveVideo with your Manning credentials to join the discussion!

Thank you for your engagement in the AoF over the years! We look forward to offering you a more enhanced forum experience.

g-loc (7) [Avatar] Offline
#1
if i copy the xaml code in rc xaml designer i obtain this error

COMException: The Panel you are using for the Control is not allowed as an ItemsPanel for the Control.
PatrickHastings (3) [Avatar] Offline
#2
Re: error with Listing 1.2 Updated UI with the ListBox of Tweets
Yep Getting the same thing here as well.

Don't suppose you have any resolution for this?
PatrickHastings (3) [Avatar] Offline
#3
Re: error with Listing 1.2 Updated UI with the ListBox of Tweets
The following seems to work: NB ApplicationPageBackgroundThemeBrush not ApplicationPageBackgroundBrush

<Grid Background="{StaticResource ApplicationPageBackgroundThemeBrush}">
<TextBlock Text="Twitter Search Results" >
Height="42" Width="425"
HorizontalAlignment="Left" VerticalAlignment="Top"
FontSize="42" Margin="80,40,0,0" />


<GridView x:Name="TweetList" Margin="80,100,80,80" Background="Transparent" >
<GridView.ItemsPanel>
<ItemsPanelTemplate>
<WrapGrid Orientation="Horizontal" MaximumRowsOrColumns="3" />
</ItemsPanelTemplate>
</GridView.ItemsPanel>

<GridView.ItemTemplate>
<DataTemplate>
<Grid Width="360" Height="80" Background="LightBlue">
<Image Margin="0" Width="80" Height="80" >
HorizontalAlignment="Left"
Source="{Binding Image}"
Stretch="Uniform"/>
<TextBlock Text="{Binding Message}" >
HorizontalAlignment="Left"
VerticalAlignment="Top"
FontSize="15"
Foreground="White"
TextWrapping="Wrap"
Margin="100,5,5,5"/>
</Grid>
</DataTemplate>
</GridView.ItemTemplate>
</GridView>
</Grid>
Psychlist1972 (177) [Avatar] Offline
#4
Re: error with Listing 1.2 Updated UI with the ListBox of Tweets
Thanks for reporting this. The first couple chapters were turned over prior to the RC, and will be updated shortly.

I'm at TechEd at the moment. Is this blocking you, or have you been able to run the demo with it? If blocking, I'll download the stuff and post the correct XAML.

Pete
PatrickHastings (3) [Avatar] Offline
#5
Re: error with Listing 1.2 Updated UI with the ListBox of Tweets
The XAML I've pasted above works so it is not blocking but it would be interesting to know why the ListBox no longer allows a WrapPanel where as a Grid View now does.

Have Fun at Tech Ed
Psychlist1972 (177) [Avatar] Offline
#6
Re: error with Listing 1.2 Updated UI with the ListBox of Tweets
I spoke with the product team, and will make some changes to the listing. Their response was that the ListView, not the ListBox, is what we need to use for Metro apps in scenarios like this.

The reason for the (new) exception is because the controls require some virtualization goodies that the ListBox does not have.

I generally agree with their statement, but know this will be quite a change for anyone coming from the "ListBox can do anything" WPF and Silverlight backgrounds, so I'll be sure to explain it in chapter 1.

Updated markup coming shortly.

Pete