私はデータを含むjsonObjectであり、このデータをWindowsPhoneの画面に表示したいと考えています。このデータは実際にはWebサービスから取得してjsonオブジェクトに変換します。しかし、Windowsアプリの新機能のため、グリッドやキャンバスなどについてはわかりません。誰かがこれを行うのを手伝ってくれますか?
これを行うために以下のコードを記述しましたが、すべてのテキストブロックが1つより下に上書きされているため、コードが正しくない可能性があります--->
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);
}
}