public async Task InitializeMapViewModel() { var cameras = new List<MapCameraViewModel>(); foreach (var camera in (IEnumerable<RemoteCameraModel>) ServerViewModel.Cameras.Source) { cameras.Add(new MapCameraViewModel(camera)); } MapViewModel = new MapViewModel(cameras, 30); await Task.Yield(); }
public async Task InitializeMapViewModelWithFrames() { var cameras = new List<MapCameraViewModel>(); foreach (var camera in (IEnumerable<RemoteCameraModel>) ServerViewModel.Cameras.Source) { var loader = await ImageLoader.Create(camera); cameras.Add(new MapCameraViewModel(camera, await loader.GetFrameImages())); } MapViewModel = new MapViewModel(cameras, 30); MapViewModel.CanvasVisible = Visibility.Collapsed; await Task.Yield(); }