Declaring an instance variable for an OxyPlot graphing object

Oystein Bjorke 10 years ago 0
This discussion was imported from CodePlex

faroskalin wrote at 2013-12-06 16:52:

I am using OxyPlot, a graphing library for C#. What confuses me so far is the type for some of the constructors. A code snippet is below:

Image

This generates this image:

Image

(It's a heat map)


My question is - what is var? For example, when you create a new multidimensional array, you do this:
double[,] doubleArray = new double[columns, rows];
Understandingly, the type for this is a double[,]. Why I need to know this is that I would like to store the heatmap as an instance variable, more specifically, heatMapSeries1.Data as a multi-dimensional array. However, in VS, I am unable to declare var as the type for an instance variable. The only selection I get is this:

Image

Any OxyPlot pros in here could lend me a hand? Thank you.

objo wrote at 2013-12-06 18:17:

You can only use var within method scope:
http://msdn.microsoft.com/en-us/library/bb383973.aspx
use explicit types for fields and properties.
I prefer to use var where possible, it reduces code duplication.

faroskalin wrote at 2013-12-06 18:59:

Ah I understand now.

Thanks.