/// <summary> /// /// </summary> /// <param name="type"></param> public void SetControl(FormType type) { if (StackPanel != null && !Dispatcher.CheckAccess()) { ChangeControl d = SetControl; Dispatcher.Invoke(d, type); } else { switch (type) { case FormType.Conversation: MainGrid.Children.Remove(StackPanel); StackPanel = new Conversation(); Info.Text = string.Format("{0}: {1}", ChatHelper.CONVERSATION, caller); break; case FormType.Incoming: StackPanel = new IncomingCall(); Info.Text = string.Format("{0}: {1}", ChatHelper.INCOMING_CALL, caller); break; case FormType.Outcoming: StackPanel = new OutcomingCall(); Info.Text = string.Format("{0}: {1}", ChatHelper.OUTCOMING_CALL, caller); break; case FormType.File: StackPanel = new RecieveFile(); Info.Text = string.Format(ChatHelper.FILE_TRANSFER, caller); break; } if (StackPanel == null) { return; } SubscribePanel(); SetControl(); } }
private void OnOutcomingCall(object sender, CallEventArgs e) { Status = PortStatus.BUSY; e.CallerPhoneNumber = PhoneNumber; OutcomingCall?.Invoke(sender, e); }