Using CSOM in a Windows 8 app for SharePoint Online

Great find by Nicolas for using CSOM in a Windows 8 app!

Nicolas Peters

Working with the Client-Side Object Model is rather easy and that’s why I looked for a solution to use it in a Windows 8 app.

There are two assemblies to be referred for working with the CSOM.

  • Microsoft.SharePoint.Client.dll
  • Microsoft.SharePoint.Client.Runtime.dll

Creating the app

Let’s start by creating a new Class Library for Windows Store apps.
In here we add the references to the SharePoint assemblies.
In our Windows 8 app, we add a reference to our newly created class library.

Untitled

To be able to invoke methods on SharePoint Online using the Client-Side Object Model (CSOM), we need to authenticate first.
The authentication is based on this solution found on MSDN Blogs:
http://blogs.msdn.com/b/omarv/archive/2012/10/25/windows-8-store-apps-office-365-enterprise-preview-sharepoint-online.aspx

When the app starts, the app will try to retrieve the credentials from the password vault to connect to SharePoint. If the credentials from the password vault are empty, you’ll get the input fields to pass your credentials and login.

View original post 70 more words