Commit 169033ef authored by 潘栩锋's avatar 潘栩锋 🚴

IBCSystemClient 没有继承INotifyPropertyChanged, 导致界面不会更新 IBC服务器连接断开

parent c7392bef
......@@ -57,7 +57,7 @@ namespace FLY.IBC.UI.Client.UIModule
reason_list_index--;
if (reason_list_index < 0)
reason_list_index = mWindow.Record.Count();
updateError();
updateError01();
};
mWindow.Record.CollectionChanged += Record_CollectionChanged;
......@@ -81,25 +81,28 @@ namespace FLY.IBC.UI.Client.UIModule
{
if (e.PropertyName == "IsConnected")
{
updateError();
updateError01();
}
};
updateError();
updateError01();
}
private void Record_CollectionChanged(object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e)
{
reason_list_index = mWindow.Record.Count() - 1;
updateError01();
}
void updateError01()
{
FObjBase.PollModule.Current.Poll_JustOnce(
new FObjBase.PollModule.PollHandler(delegate ()
{
reason_list_index = mWindow.Record.Count() - 1;
updateError();
}), this, MARKNO_UPDATEERROR);
}
void updateError()
{
if (!iBCSystemClient.IsConnected)
......
......@@ -15,7 +15,7 @@ using System.Threading.Tasks;
namespace FLY.IBC.Client
{
public class IBCSystemClient : FObj, IIBCSystemService
public class IBCSystemClient : FObj, IIBCSystemService,INotifyPropertyChanged
{
public BufferServiceClient<Db_Width> CtrlList;
#region IIBCSystemService
......@@ -32,8 +32,23 @@ namespace FLY.IBC.Client
public IPLCProxySystemService PLCos { get; private set; }
#endregion
public bool IsConnected { get; set; } = false;
//private bool isConnected;
public bool IsConnected
{
get;set;
}
//{
// get {
// return isConnected;
// }
// set {
// if (isConnected != value)
// {
// isConnected = value;
// this.PropertyChanged?.Invoke(this, new PropertyChangedEventArgs("IsConnected"));
// }
// }
//}
IFConn mConn;
UInt32 mServerID;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment