Page 1 of 1

Update modelview from another thread (Unity3D)

Posted: 30 Jun 2016, 18:18
by jeroenvdv
Hi all,

I've got a seperate thread for loading data from an USB stick. This thread should update the user interface with the current filename.

This crashes the Unity Editor (and the standalone application) almost immediately.

In the modelview:
private object _LockObject = new object();
protected string _progressString;
public string progressString
{
	get { 
		lock (_LockObject) {
			return _progressString;
		}
	}
	set {
		lock (_LockObject) {
			_progressString = value;
			NotifyPropertyChanged ("progressString");
		}
	}
}
From within the thread:
_mainWindow.progressString = filename;
Did I make a mistake or is this just not possible - or not the right way..?

Re: Update modelview from another thread (Unity3D)

Posted: 30 Jun 2016, 18:55
by jsantos
NoesisGUI API can only be accessed from the main Unity thread in the current version. We are working in 1.3 to support several UIs in several threads but this is mainly for the native SDK, I don't think it will apply for the Unity integration. We will also try to support loading XAML's in worker thread, but that is a different thing.