I am having issues with my textblock content, the content does not show completely.
Whenever i scroll up is always truncated. i have tried increasing the textblock/scrollviewer hieght is still the same
see the code below
xaml
xaml.cs
namespace DevotionJson
{
public partial class BibleInYear : PhoneApplicationPage
{
private List devotions;
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(json);
}
return d[0];
}
}
}
Kindly help
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
JOHN JOHNNNYPosted Jan 20, 2016, 9:08 AM
Aman KumarPosted Jan 20, 2016, 8:14 AM
JOHN JOHNNNYPosted Jan 20, 2016, 8:10 AM
Aman KumarPosted Jan 19, 2016, 12:38 PM