Dzien dobry,
Mam problem z bindowaniem.
Ponizesze bindowanie robione jest w Form_Show
lblServerName - to label.
Binding BindlblServerName = new Binding("Text", OPCInterface, "ServerName");
BindlblServerName.Format += (sender1, e1) => e1.Value = "OPC DA: " + e1.Value;
lblServerName.DataBindings.Add(BindlblServerName);
OPCInterface to obiekt mojej wlasnej klasy OPCServerInterface:
public class OPCServerInterface {
public delegate void dLogMsg(string aProcess, bool aExtDiag, string aLine);
public dLogMsg LogMsg;
public bool IsConnected { get { return _OpcSrv.isConnectedDA; } }
public string ServerName { get { return _OpcSrv.ServerName; } }
....
}
W momencie bindowanie OPCInterface._OpcSrv == null
wiec lblServerName.Text == "OPC DA: "
Potem jedank nazwa serwera sie zmienia, a lblServerName.Text juz nie ;(
Nawet jak dodalem dodatkowa zmienna, zeby properities ServerName nie wskazywalo na null podczas bindowania to I tak nie dziala