visual studio 2012 - Error in MVVM when building -
i created pcl called tipcalc>core, tutorial witch building one . here tipviewmodel.cs
using cirrious.mvvmcross.viewmodels; namespace tipcalc.core { public class tipviewmodel : mvxviewmodel { private readonly icalculation _calculation; public tipviewmodel(icalculation calculation) { _calculation = calculation; } public override void start() { _subtotal = 100; _generosity = 10; recalcuate(); base.start(); } private double _subtotal; public double subtotal { { return _subtotal; } set { _subtotal = value; raisepropertychanged(() => subtotal); recalcuate(); } } private int _generosity; public int generosity { { return _generosity; } set { _generosity = value; raisepropertychanged(() => generosity); recalcuate(); } } private double _tip; public double tip { { return _tip; } set { _tip = value; raisepropertychanged(() => tip); } } private void recalcuate() { tip = _calculation.tipamount(subtotal, generosity); } } }
the problem when cuild pcl, following errors:
error 1 type or namespace name 'icalculation' not found (are missing using directive or assembly reference?) tipcalc.core error 2 type or namespace name 'icalculation' not found (are missing using directive or assembly reference?)
altough interface , class,are right there in services folder,in project.
calculation.cs
using system; using system.collections.generic; using system.linq; using system.text; namespace tipcalc.core.services { public class calculation : icalculation { public double tipamount(double subtotal, int generosity) { return subtotal * ((double)generosity) / 100.0; } } }
and icalculation.cs
using system; using system.collections.generic; using system.linq; using system.text; namespace tipcalc.core.services { public interface icalculation { double tipamount(double subtotal, int generosity); } }
any please?
you need add using in calculation.cs
to use icalculation.cs
using tipcalc.core.services;
Comments
Post a Comment