I have two class.
One has data about class, other send to data when serial communication.
Example
class Data
{
public int Voltage = 10;
}
class ForCommunication
{
public object values;
}
...
// Main Form
Data Data = new Data();
private void SetValue
{
ForCommunication fc = new ForCommunication();
fc.values = Data.Voltage;
}
And even if fc.values were changed by serial communications, the Data.Voltage does not change.
I want change Data.Voltage when fc.values change.
Example
// init values
Data.Voltage = 10;
fc.values = Data.Voltage;
fc.values = 10;
// Data.Voltage : 10, fc.values : 10
// fc.values change
fc.values = 15;
// and I want Data.Voltage change
// fc.values : 15, Data.Voltage : 15
Is It possible on C#?
Should I find another way?