如何将全景项目转换为页面/数据网格

时间:2013-10-19 20:24:57

标签: xaml windows-phone-7

我是Windows手机开发的新手。我正在关注这篇优秀的文章(http://developer.nokia.com/Community/Wiki/Weather_in_Windows_Phone_7),并学习了如何加载xml数据并在paronama视图中将其显示为有用的信息。但现在我想把它显示为一个页面,而不是全景。我不确定它是否在我应该使用的页面标记或数据网格标记中。有人可以帮我解决如何将这段代码转换成可以在页面中显示的东西

// create PanoramaItem            
PanoramaItem panoramaItem = new PanoramaItem();            
panoramaItem.Header = queries[query];            
// modify header to show only city (not the country)            
int index = queries[query].IndexOf(",");            
if (index != -1) 
panoramaItem.Header = queries[query].Substring(0,queries[query].IndexOf(","));
else panoramaItem.Header = queries[query];            
// use ForecastTemplate in Panorama Item     
panoramaItem.ContentTemplate=(DataTemplate)Application.Current.Resources["ForecastTemplate"];
panoramaItem.Content = pio; // add Panorama Item to Panorama
Panorama.Items.Add(panoramaItem); // query next city forecast

1 个答案:

答案 0 :(得分:-1)

  • 首先,确保Pivot对你没用。它像Panorama,但是Pivot :)看到差异hereherehere(nice one)here

  • 试图在这里粘贴一些代码,但是SO没有显示标签。那么,看一下< .Grid.ColumnDefinitions>和< .Grid.RawDefinitions>。开头的点只是用于渲染。