private void CaptureBtn_Click(object sender, RoutedEventArgs e) { try { if (_ViewCaptureTrigger != null) { _ViewCaptureTrigger.Enabled = !_ViewCaptureTrigger.Enabled; return; } if (_Capturer is RtcCapturer) { ((RtcCapturer)_Capturer).InjectRtc(_ClientPeer._WebRtc); } _ViewCaptureTrigger = new Timer { Interval = 1000 / _CaptureInfo.CaptureFps, }; _ViewCaptureTrigger.Elapsed += (s, o) => { _ScreenView = _Capturer.CaptureView(); RefreshLocalView(); }; _ViewCaptureTrigger.Enabled = true; } catch (Exception ex) { } }