/// <summary> Конструктор </summary> public ViewModelCallActive() { CallbackRouter.Instance.ModelCallChanged += OnModelCallChanged; CurrentModelCall = DataSourceCall.GetListActiveCall()?.FirstOrDefault(); if (CurrentModelCall == null) { OnCloseView(); } CommandHangupCall = new Command(obj => HangupCall()); CommandAcceptCall = new Command(obj => AcceptCall()); CommandMuteMicrophone = new Command(obj => MuteMicrophone()); ExistCall = true; }
/// <summary> Конструктор </summary> public ViewModelCallActive(ModelContact modelContact, string number) { CallbackRouter.Instance.ModelCallChanged += OnModelCallChanged; if (DataSourceCall.StartOutgoingCallUrl(modelContact, number)) { CurrentModelCall = DataSourceCall.GetListActiveCall()?.FirstOrDefault(); } else { OnCloseView(); } CommandHangupCall = new Command(obj => HangupCall()); CommandMuteMicrophone = new Command(obj => MuteMicrophone()); ExistCall = true; }
/// <summary> Обработчик изменения состояния звонка внутри логики C++ </summary> private void LogicModelCallChangedHandler() { var modelCall = DataSourceCall.GetListActiveCall()?.FirstOrDefault(); OnModelCallChanged(modelCall); }