Was unable to find any answer for this problem, so came up with a workaround of my own. First, I check the length of the content to be displayed and then if is more then 4000 character length then I divide it into two parts. Then also add an application bar with the more button , so that the user can click on the button and view the remaining text. Here is the code
{
if (commentry.Length > 4000 && commentry.IndexOf("<p>", commentry.Length / 2) > 0)
{
//Change the xaml to contain a panaroma , and if then on the second item create web browser control with the second half of the commentry.
commentry1 = commentry.Remove(commentry.IndexOf("<p>", commentry.Length / 2), commentry.Length - commentry.IndexOf("<p>", commentry.Length / 2));
commentry2 = commentry.Remove(0, commentry.IndexOf("<p>", commentry.Length / 2));
appBarMoreButton = new ApplicationBarIconButton(new Uri("/Images/quote.back.png", UriKind.Relative));
appBarMoreButton.Text = "more";
appBarMoreButton.Click += new EventHandler(loadMoreContent);
appBarPreviousButton = new ApplicationBarIconButton(new Uri("/Images/quote.back.png", UriKind.Relative));
appBarPreviousButton.Text = "Previous";
appBarPreviousButton.Click += new EventHandler(loadFirstPart);
}
var htmlScript = "<script>function getDocHeight() { " +
"return document.getElementById('pageWrapper').offsetHeight;" +
"}" +
"function SendDataToPhoneApp() {" +
"window.external.Notify('' + getDocHeight());" +
"}</script>";
if (commentry1 == null && commentry2 == null)
{
var htmlConcat = string.Format("<html><meta name=\"viewport\" content=\"width=device-width,user-scalable=yes,height=device-height\" /><head>{0}</head>" +
"<body style=\"margin:5px;padding:0px;background-color:{3};\" " +
"onLoad=\"SendDataToPhoneApp()\">" +
"<div id=\"pageWrapper\" style=\"width:100%;color:{2}; background-color:{3}\"> " +
"{1}</div></body><footer></footer></html>",
htmlScript,
commentry, fontColor, backGroundColor);
discusswebBrowser.NavigateToString(htmlConcat);
}
else
{
var htmlConcat = string.Format("<html><meta name=\"viewport\" content=\"width=device-width,user-scalable=yes,height=device-height\" /><head>{0}</head>" +
"<body style=\"margin:5px;padding:0px;background-color:{3};\" " +
"onLoad=\"SendDataToPhoneApp()\">" +
"<div id=\"pageWrapper\" style=\"width:100%;color:{2}; background-color:{3}\"> " +
"{1}</div></body><footer></footer></html>",
htmlScript,
commentry1, fontColor, backGroundColor);
discusswebBrowser.NavigateToString(htmlConcat);
ApplicationBar = new ApplicationBar();
ApplicationBar.IsVisible = true;
ApplicationBar.Mode = ApplicationBarMode.Minimized;
ApplicationBar.IsMenuEnabled = false;
ApplicationBar.Buttons.Add(appBarMoreButton);
}
discusswebBrowser.ScriptNotify +=
new EventHandler<NotifyEventArgs>(wb1_ScriptNotify);
}
For the event handler for the more button create a function that will load the remaining text along with a button in the application bar to move back to the first part.
private void loadMoreContent(object sender, EventArgs e)
{
if (commentry2 != null)
{
var htmlScript = "<script>function getDocHeight() { " +
"return document.getElementById('pageWrapper').offsetHeight;" +
"}" +
"function SendDataToPhoneApp() {" +
"window.external.Notify('' + getDocHeight());" +
"}</script>";
var htmlConcat = string.Format("<html><meta name=\"viewport\" content=\"width=device-width,user-scalable=yes,height=device-height\" /><head>{0}</head>" +
"<body style=\"margin:5px;padding:0px;background-color:{3};\" " +
"onLoad=\"SendDataToPhoneApp()\">" +
"<div id=\"pageWrapper\" style=\"width:100%;color:{2}; background-color:{3}\"> " +
"{1}</div></body><footer></footer></html>",
htmlScript,
commentry2, fontColor, backGroundColor);
discusswebBrowser.NavigateToString(htmlConcat);
this.ApplicationBar.Buttons.RemoveAt(0);
this.ApplicationBar.Buttons.Add(appBarPreviousButton);
}
}