In the header change the declaration to:
public ref class Test
{
public:
property int MyProperty
{
int get();
void set( int );
}
private:
int m_myProperty;
};
Then, in the cpp code file write your definitions like this:
int Test::MyProperty::get()
{
return m_myProperty;
}
void Test::MyProperty::set( int i )
{
m_myProperty = i;
}
The reason you are seeing errors is that you have declared a trivial property where the compiler generates an implementation for you. But, then you tried to provide an implementation explicitly as well. See: http://msdn.microsoft.com/en-us/library/windows/apps/hh755807(v=vs.110).aspx
Most of the examples online only show implementations directly in the class definition.