/// <summary> /// Return the requested camera view model /// </summary> /// <param name="cameraName">name of the camera</param> /// <returns></returns> private static UserControl RetrievePage(string cameraName) { var dataContext = HKCameraManager.GetCameraByName(cameraName); return(new CameraView() { DataContext = dataContext }); }
/// <summary> /// Sets up the IoC container, binds all information required and is ready for use /// NOTE: Must be called as soon as your application starts up to ensure all /// services can be found /// </summary> public static void Setup() { // Bind all required view models BindViewModels(); // Init cameras var success = HKCameraManager.ScannedForAttachedCameras(); if (!success) { Log("Failed to scan cameras"); } }
/// <summary> /// Safely close all cameras /// </summary> /// <param name="e"></param> protected override void OnClosed(EventArgs e) { base.OnClosed(e); HKCameraManager.CloseAllCameras(); }