1
i'v一个jsonObject,其中包含数据&我想在我的Windows Phone屏幕中显示此数据。这些数据实际上是从Web服务中检索并将其转换为json对象。但由于我在Windows应用程序新,所以我不知道有关网格,画布等,所以任何人都可以帮助我做到这一点?将数据绑定到windows phone中动态创建的网格
心中已经写下面的代码要做到这一点,但所有的TextBlocks都overwritting下面一个,也许有可能是它不是正确的代码--->
for (var rows = 0; rows < jsonObject["data"].Count(); rows++)
{
for (var cols = 0; cols < jsonObject["data"][rows].Count(); cols++)
{
ColumnDefinition scheduleTimeColumn = new ColumnDefinition();
GridLength timeGrid = new GridLength(10);
scheduleTimeColumn.Width = timeGrid;
grid1.ColumnDefinitions.Add(scheduleTimeColumn);
TextBlock timeTxtBlock = new TextBlock();
timeTxtBlock.Text = (String)jsonObject["data"][rows][cols];
timeTxtBlock.FontSize = 28;
timeTxtBlock.Margin = new Thickness(0, 20, 0, 0);
Grid.SetColumn(timeTxtBlock, 0);
grid1.Children.Add(timeTxtBlock);
}
}