Hello,
I am developming custom Behavior for "ArcGIS for SharePoint". I have started by selecting "ArcGIS viewer for Silverlight project".
In this project, there are two files .xaml and MyBhavaior.cs file. I am using Silverlight client object model to get SharePoint list data in MyBhavaior.cs file, but my ClientContext is always null and throws an error even though I get right URL of SharePoint site. Anyone can help me to resolve it ?
Please find implemented code below.
#region Behavior Overrides
protected override void OnAttached()
{
base.OnAttached();
List<string> KMZUrls = new List<string>();
ClientContext _clientContext = new ClientContext(ApplicationContext.Current.Url);
Web rootWeb = _clientContext.Site.RootWeb;
_clientContext.Load(rootWeb);
List list = rootWeb.Lists.GetByTitle("SharePoint List");
CamlQuery query = new CamlQuery();
query.ViewXml = "<View><Query></Query></View>"; //List<string> KMZUrls = new List<string>();
ListItemCollection items = list.GetItems(query);
.......
}
Thanks,
Satyam