public Node GetApplicationContext()
{
var context = ContextNode;
//If the requested node is an app and the action
//is browse, than return that node.
if (context is Page && (ActionName == null || ActionName.ToLower() == "browse"))
return context;
//If a context node was given in the url than
//the original requested node should be an app.
//In this case the page property will contain that content.
var contextNodePath = HttpContext.Current.Request.Params[ContextNodeParamName];
if (!string.IsNullOrEmpty(contextNodePath))
return this.Page;
return null;
}