Note that there are some explanatory texts on larger screens.

plurals
  1. POAnother "Object does not contain a definition for X"
    primarykey
    data
    text
    <p>I saw a lot of topics with the problem:</p> <p>"Object does not contain a definition for X and no extension method X accepting a first argument of type Object"</p> <p>But none of them had the solution to my problem.</p> <p>Situation: I want to save 3 series of DataPoints. Therefor i made a List that holds the series:</p> <pre><code>List&lt;OxyPlot.Series.DataPointSeries&gt; filesToBeStored; public OxyPlot.Series.DataPointSeries saveAnalyseBSITotal; public OxyPlot.Series.DataPointSeries saveAnalyseSBSI; public OxyPlot.Series.DataPointSeries saveAnalyseTBSI; </code></pre> <p>In the Form.cs I call the SaveFile(...):</p> <pre><code> for (int i = 0; i &lt; plotSBSIBandsA.Model.Series.Count; i++) { OxyPlot.Series.DataPointSeries sA = (plotSBSIBandsA.Model.Series[i] as OxyPlot.Series.DataPointSeries); OxyPlot.Series.DataPointSeries sB = (plotSBSIBandsB.Model.Series[i] as OxyPlot.Series.DataPointSeries); sB.Points.Clear(); for (int j = 0; j &lt; sA.Points.Count; j++) { sB.Points.Add(new OxyPlot.DataPoint(sA.Points[j].X, sA.Points[j].Y)); } } if(saveButtonClicked) {this.SaveFile(sB)} </code></pre> <p>The complete Save-Class is:</p> <pre><code> using System; using System.Collections.Generic; using System.Linq; using System.Text; namespace BSIAnalyzer { class SaveFile { List&lt;OxyPlot.Series.DataPointSeries&gt; filesToBeStored; public OxyPlot.Series.DataPointSeries saveAnalyseBSITotal; public OxyPlot.Series.DataPointSeries saveAnalyseSBSI; public OxyPlot.Series.DataPointSeries saveAnalyseTBSI; public SaveFile(OxyPlot.Series.DataPointSeries sA) { for (int i = 0; i &lt; sA.Points.Count; i++) { saveAnalyseBSITotal.Points.Add(new OxyPlot.DataPoint(sA.Points[i].X, sA.Points[i].Y)); } } public SaveFile(List&lt;OxyPlot.Series.DataPointSeries&gt; series) { filesToBeStored.Insert(0, saveAnalyseBSITotal); filesToBeStored.Insert(1, saveAnalyseSBSI); filesToBeStored.Insert(2, saveAnalyseTBSI); for (int k = 0; k &lt; series.Count; k++) { filesToBeStored[k].Points.Add(new OxyPlot.DataPoint(series[k].Points.X, series[k].Points.Y)); } } } } </code></pre> <p>In the forloop with te "k" i got the error.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload