12345678910111213141516171819202122232425262728293031323334353637 |
- using System;
- using System.Collections.Generic;
- using System.Linq;
- using System.Text;
- using System.Threading.Tasks;
- using XdCxRhDW.App.Model;
- using XdCxRhDW.App.UserControl;
- namespace XdCxRhDW.App.ObServer
- {
- public class PosObServer
- {
- private static PosObServer _ins =new PosObServer();
- private PosObServer()
- {
- }
- public static PosObServer Instance => _ins;
- /// <summary>
- /// 定位推送事件
- /// </summary>
- public event Action<PosRes> OnPosChanged;
- public void Sub(Action<PosRes> action)
- {
- OnPosChanged += action;
- }
- public void DisposeSub(Action<PosRes> action)
- {
- OnPosChanged -= action;
- }
- public void Pub(PosRes data)
- {
- OnPosChanged?.Invoke(data);
- }
- }
- }
|