I have problem with failing RaisePropertyChanged in my application. It is called after receiving message from another class. This message is sent after await
calling.
var storedData = await localFolder.GetFileContentAsync("data.json").ConfigureAwait(false);
if (!string.IsNullOrEmpty(storedData))
{
snags = JsonConvert.DeserializeObject<Data>(storedData);
messenger.Send(new ChangeDataCountMessage());
}
Failing RaisePropertyChanged
public Data DataProperty
{
get { return dataProperty; }
set
{
dataProperty = value;
RaisePropertyChanged();
}
}
This call of RaisePropertyChanged throws exception
An exception of type 'System.Runtime.InteropServices.COMException' occurred in System.dll but was not handled in user code
Additional information: The application called an interface that was marshalled for a different thread. (Exception from HRESULT: 0x8001010E (RPC_E_WRONG_THREAD))
Additional info :
I use portable GalaSoft.MvvmLight (Messenger, RaisePropertyChanged etc.) v. 4.4
all this happens in PortableClassLibrary
it is not happening all the time
I don't send any data from another thread
Could you help me please?