MVVM error

Hi, we are evaluating GoXam for WPF but we have an error when we try to instantiate a

public class MyData : GraphLinksModelNodeData
// define node data properties; setters should call RaisePropertyChanged

in our ViewModel. Visual Studio thrown an exception “STAT attribute is required for the application”. We don’t understand why we have this error, it seems the object GraphLonkModelNodeData use somethings from UI but no references there is between ViewModel and View…

Best regards

GraphLinksModelNodeData is a generic type – you probably need to use a constructed type by filling in the type parameters as needed by your app. Maybe something like:
public class MyData : GraphLinksModelNodeData<String> ...

Hi Walter,

we have created an example test program. Everytime we instantiate, in a secondary thread, an object inherited by GraphLinksModel<…, …, …, …> we have the error: “The calling thread must be STA, because many UI components require this”.

There is no references of the GoWPF in XAML file.

Could you give us some information about this problem.

I have uploaded 2 images with the code behind of the project.

Best regards

The GraphLinksModel and its data form the ViewModel, and that data should be manipulated on the UI thread.