Hi I am looking for some very basic information about c# coding in general and especially WPF.
First of all I do not really understand, when I have to update a form component in WPF with Invoke and when not.
For example if you have a simple button click event you usally do something like this in it:
this.label1.content = this.dataObject.Position;
But if you for example poll a lot of data you usually invoke label 1.
I do not understand when I have to invoke and when not. Does it depend on my dataObject instance? For example when I have my WPF form and another class in my Project which is called dataObject.cs and I initialize this class with
private dataObject dataO = new dataObject();
in my WPF form, do i have to invoke it, when I use it, because it is another class? Or rather do I not have to invoke it, because it is initialized in my gui and thus the GUI thread is handling the class anyway? So in which cases I have to invoke a dataobject?
Secondly I would like to get information about how to improve performance and data allocation in c#. For example, at which place in my gui do I declare new threads, variables etc. for best performance? Where do I initialize them? When is it recommended to create another class which handles all my parameters and how do I call this class (and where) in my WPF code? Maybe you know some good tutorials or books in general which focus on this topic.
Thanks a lot!