2013-10-13 5 views
0
내가 잘 작동하지만 this

오류 (윈도우 폰 8)

모두에서 윈도우 폰 8의 스토리지에서 오브젝트를 작성 찾고 있었다

내가 함께 Load 메서드를 호출 할 때 : IsolatedStorageOperations.Load<Friend>("myXML.xml")

Cannot implicitly convert type 'System.Threading.Tasks.Task 
          <'friendsbook.Lib.Friend'>' to 'friendsbook.Lib.Friend' 

또한 작동하지 않습니다 :

IsolatedStorageOperations.Load("myXML.xml") 

난 항상 오류를 얻을 수

하지만 Save 메서드를 호출해도 문제가 없습니다 !!!

누구든지이 문제에 대해 도움을 줄 수 있습니까?

감사합니다. 를 호출 할 때

답변

0

IsolatedStorageOperations.Load<Friend> 방법은 비동기의 await 키워드를 사용

var friend = await IsolatedStorageOperations.Load<Friend>("myXML.xml"); 
+0

감사 답변을 위해! 그러나 비동기 메서드 내에서만 대기를 사용할 수 있습니다 – GC268DM

+0

메서드를 비동기로 표시 –

+0

또는 메서드를 동 기적으로 호출 할 수 있습니다 :'var friend = IsolatedStorageOperations.Load ("myXML.xml") 결과 :' –