private void AudioCallBlockLoaded(object sender, RoutedEventArgs e) { _audioCallViewModel = ((CallViewModel) DataContext).Audio; _audioCallViewModel.MicrophoneIsNotAvailable += MicrophoneIsNotAvailableHandler; _audioCallViewModel.StartRinging += StartRingingHandler; _audioCallViewModel.StopRinging += StopRingingHandler; _audioCallViewModel.PropertyChanged += PropertyChangedHandler; var state = (string) new CallStateToStringConverter().Convert(_audioCallViewModel.State, typeof (string), null, null); VisualStateManager.GoToState(this, state, false); }
public void DeregisterEventHandlers(AudioCallViewModel audioCallViewModel) { audioCallViewModel.StartRinging -= StartRingingHandler; audioCallViewModel.StopRinging -= StopRingingHandler; }