public async void ConfigureWith(ListInfo listInfo) { await listInfo.FetchInfoAsync (); if (document != null) { document.DocumentDeleted -= OnListDocumentWasDeleted; document.Close (null); } document = new ListDocument(listInfo.Url); document.DocumentDeleted += OnListDocumentWasDeleted; NavigationItem.Title = listInfo.Name; TextAttributes = new UIStringAttributes { Font = UIFont.PreferredHeadline, ForegroundColor = AppColors.ColorFrom(listInfo.Color.Value) }; }
async void ProcessMetadataItems() { Console.WriteLine ("ProcessMetadataItems"); NSMetadataItem[] metadataItems = documentMetadataQuery.Results; // We only expect a single result to be returned by our NSMetadataQuery since we query for a specific file. if (metadataItems.Length == 1) { var url = (NSUrl)metadataItems [0].ValueForAttribute (NSMetadataQuery.ItemURLKey); if (document != null) document.Close (null); document = new ListDocument (url); var success = await document.OpenAsync (); if (!success) { Console.WriteLine ("Couldn't open document: {0}.", document.FileUrl.AbsoluteString); return; } ResetContentSize(); TableView.ReloadData(); } }