Beispiel #1
0
 /// <summary>
 /// Returns a content view model for the specified object which needs to be displayed as a document
 /// The object could be anything - based on the handlers, a content view model is returned
 /// </summary>
 /// <param name="info">The object which needs to be displayed as a document in Wider</param>
 /// <returns>The content view model for the given info</returns>
 public ContentViewModel GetViewModel(Object info)
 {
     for (Int32 i = ContentHandlers.Count - 1; i >= 0; i--)
     {
         IContentHandler opener = ContentHandlers[i];
         if (opener.ValidateContentType(info))
         {
             ContentViewModel vm = opener.OpenContent(info);
             vm.Handler = opener;
             return(vm);
         }
     }
     return(null);
 }