jeroenvdv
Topic Author
Posts: 13
Joined: 15 Sep 2014, 20:21

Update modelview from another thread (Unity3D)

30 Jun 2016, 18:18

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..?
 
User avatar
jsantos
Site Admin
Posts: 2947
Joined: 20 Jan 2012, 17:18
Contact:

Re: Update modelview from another thread (Unity3D)

30 Jun 2016, 18:55

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.

Who is online

Users browsing this forum: No registered users and 5 guests