public MainWindow() { InitializeComponent(); myVM = new ViewModel(); myVM.cameras = new List <WebCameraId>(Webcam.GetVideoCaptureDevices()); myVM.SelectedCamera = myVM.cameras[0]; this.DataContext = myVM; }