Hi
Using the below code in my app the text is truncated, i think it exceeds the
2048x2048 pixels. when i googled a solution i was told to divide up my text
into multiple blocks to display it all. Can anyone please show me how to do this
see my code below
xaml
xaml.cs
namespace DevotionJson
{
public partial class BibleInYear : PhoneApplicationPage
{
private List
public BibleInYear()
{
InitializeComponent();
devotions = new List
AddDevotions();
}
protected override void OnNavigatedTo(NavigationEventArgs e)
{
DateTime dt = DateTime.Now;
int month = dt.Month;
int year = dt.Year;
int index;
if (DateTime.IsLeapYear(year) || (month <= 2))
{
index = dt.DayOfYear - 1; // list is indexed from 0
}
else
{
index = dt.DayOfYear; // add a day
}
textblock.Text = devotions[index].ToString(); // or some other property
}
private void AddDevotions()
{
for (int i = 1; i <= 366; i++)
{
string filePath = "BibleInYear/Bible" + i.ToString() + ".json";
BibleData d = ReadJsonFile(filePath);
devotions.Add(d);
}
}
public BibleData ReadJsonFile(string JsonfilePath)
{
BibleData[] d = null;
using (StreamReader r = new StreamReader(JsonfilePath))
{
string json = r.ReadToEnd();
d = JsonConvert.DeserializeObject
}
return d[0];
}
}
}
Kindly help
Replies
Know the answer? Post it — somebody with the same question will find it here.