public PlaybackViewModel(IOnvifServiceAggregator onvifServiceAggregator, IMvxMessenger messenger, IMvxJsonConverter jsonConverter, ISettings settingsStorage) : base(messenger, jsonConverter) { _onvifServiceAggregator = onvifServiceAggregator; _settingsStorage = settingsStorage; MediaPlayerViewModel = new MediaPlayerViewModel(messenger, true); RestAPIViewModel = new RestAPIViewModel(messenger, jsonConverter); }
public void Init(string token) { if (token == null) { throw new ArgumentNullException(nameof(token)); } var profileModels = _settingsStorage .GetValue <string>(SettingsKeys.Profiles) .FromJson <ICollection <ProfileModel> >(JsonConverter); ProfileModel = profileModels.SingleOrDefault(pm => pm.Token == token); RestAPIViewModel.InitRestAPI(); RestAPIViewModel.CameraName = ProfileModel.Name; RestAPIViewModel.SelectedPlaybackStartsEvent += HandleSelectedPlaybackStartsEvent; }