private void OnActivate(IDeviceInfo moniker) { activeDevice = moniker as MfDevice; var format = string.Empty; var hr = camProcess.SetDevice(activeDevice, ref format); if (!string.IsNullOrEmpty(format)) { eventAggregator.GetEvent <NoticeFormatEvent>().Publish(format); } MFError.ThrowExceptionForHR(hr); }