private void StopService() { MainViewModel.Instance.DialogVM.ShowDialog("Service Ended", "Service ended. Thank you for using our service today!", "Ok", null, DialogType.Audio, DialogMode.SingleAction); isconnecting = false; MainViewModel.Instance.IsConnected = false; AppCombo.IsEnabled = true; StartAudioPromptButton.IsEnabled = true; MainViewModel.Instance.BasicGuidanceVM.StopService(); MainViewModel.Instance.CanPlayDemoVideo = false; StopControlButton.Visibility = Visibility.Collapsed; RemoteNetworkGrid.IsEnabled = false; StartServiceButton.IsEnabled = true; MainViewModel.Instance.RemoteSupportVM.Reset(); MainViewModel.Instance.ConciergeVM.StopService(); MainViewModel.Instance.PersonalShopperVM.StopService(); ConciergeButton.Reset(); StopTwoWayVideoButton.IsEnabled = true; StopPresentingButton.IsEnabled = false; MainViewModel.Instance.CollaborationVM.Reset(); MainViewModel.Instance.TimerVM.StopTimer(); (this.Resources["ConnectingAnimation"] as Storyboard).Stop(); (this.Resources["ConnectingProgressAnim"] as Storyboard).Stop(); (this.Resources["NotconnectingState"] as Storyboard).Begin(); StopAudioPromptButton.IsEnabled = TakeControlPromptButton.IsEnabled = StopControlPromptButton.IsEnabled = false; DisconnectAudioJackButton.IsEnabled = true; }
private void Dialog_CloseDialog(object sender, EventArgs e) { var dialog = sender as DialogControl; if (MainViewModel.Instance.DialogVM.DialogState == DialogType.Chat && dialog.IsAllowed) { MainViewModel.Instance.BasicGuidanceVM.IsChatOpen = true; if (ChatControl.IsFullScreen) { ChatControl.IsFullScreen = false; } } if (MainViewModel.Instance.DialogVM.DialogState == DialogType.Audio && dialog.IsAllowed) { MainViewModel.Instance.TimerVM.StartTimer(); MainViewModel.Instance.BasicGuidanceVM.HasAudio = true; MainViewModel.Instance.BasicGuidanceVM.IsChatMinimized = true; MainViewModel.Instance.BasicGuidanceVM.IsControlOpened = true; MainViewModel.Instance.BasicGuidanceVM.IsChatOpen = false; StartAudioPromptButton.IsEnabled = false; StopAudioPromptButton.IsEnabled = true; if (!StopControlPromptButton.IsEnabled) { TakeControlPromptButton.IsEnabled = true; } } if (MainViewModel.Instance.DialogVM.DialogState == DialogType.AllowControl && dialog.IsAllowed) { StopControlButton.Visibility = Visibility.Visible; TakeControlPromptButton.IsEnabled = false; StopControlPromptButton.IsEnabled = true; MainViewModel.Instance.ConciergeVM.HasControl = true; ConciergeButton.IsOpened = true; MainViewModel.Instance.TimerVM.StartTimer(); } if (MainViewModel.Instance.DialogVM.DialogState == DialogType.StopControl && dialog.IsAllowed) { StopControlButton.Visibility = Visibility.Collapsed; TakeControlPromptButton.IsEnabled = true; MainViewModel.Instance.ConciergeVM.HasControl = false; } if (MainViewModel.Instance.DialogVM.DialogState == DialogType.StopService && dialog.IsAllowed) { isconnecting = false; MainViewModel.Instance.IsConnected = false; AppCombo.IsEnabled = true; StartAudioPromptButton.IsEnabled = true; RemoteNetworkGrid.IsEnabled = false; MainViewModel.Instance.CanPlayDemoVideo = false; ConciergeButton.Reset(); MainViewModel.Instance.RemoteSupportVM.Reset(); MainViewModel.Instance.ConciergeVM.StopService(); MainViewModel.Instance.PersonalShopperVM.StopService(); StopPresentingButton.IsEnabled = false; StartServiceButton.IsEnabled = true; StopControlButton.Visibility = Visibility.Collapsed; MainViewModel.Instance.BasicGuidanceVM.StopService(); StopTwoWayVideoButton.IsEnabled = true; MainViewModel.Instance.CollaborationVM.Reset(); (this.Resources["ConnectingAnimation"] as Storyboard).Stop(); (this.Resources["ConnectingProgressAnim"] as Storyboard).Stop(); (this.Resources["NotconnectingState"] as Storyboard).Begin(); StopAudioPromptButton.IsEnabled = TakeControlPromptButton.IsEnabled = StopControlPromptButton.IsEnabled = false; MainViewModel.Instance.TimerVM.StopTimer(); } if (MainViewModel.Instance.DialogVM.DialogState == DialogType.StartVideo && dialog.IsAllowed) { RemoteNetworkGrid.IsEnabled = true; RemoteStartVideoSharing.IsEnabled = false; RemoteStopVideoSharing.IsEnabled = true; MainViewModel.Instance.RemoteSupportVM.IsVideoConnected = true; } if (MainViewModel.Instance.DialogVM.DialogState == DialogType.Meeting && dialog.IsAllowed) { StartConnecting(); StartServiceButton.IsEnabled = false; AppCombo.IsEnabled = false; MainViewModel.Instance.IsConnected = true; MainViewModel.Instance.CollaborationVM.IsVideoShown = true; MainViewModel.Instance.CollaborationVM.IsCalenderVisible = false; MainViewModel.Instance.StartVideoCapture(); } if (MainViewModel.Instance.DialogVM.DialogState == DialogType.StopUserSharing && dialog.IsAllowed) { MainViewModel.Instance.CollaborationVM.IsUserScreenShared = false; } if (MainViewModel.Instance.DialogVM.DialogState == DialogType.StartRecording && dialog.IsAllowed) { MainViewModel.Instance.PersonalShopperVM.IsRecordingStarted = true; } }