public LoginViewController(IAlertDialogFactory alertDialogService, IDefaultValueService defaultValueService) { _alertDialogService = alertDialogService; this.WhenAnyValue(x => x.ViewModel.ShowLoginOptionsCommand) .Select(x => x.ToBarButtonItem(UIBarButtonSystemItem.Action)) .Subscribe(x => NavigationItem.RightBarButtonItem = x); this.Appearing .Take(1) .Select(_ => this.WhenAnyValue(x => x.ViewModel.LoginUrl)) .Switch() .IsNotNull() .Subscribe(LoadRequest); bool hasSeenWelcome = false; if (!defaultValueService.TryGet(HasSeenWelcomeKey, out hasSeenWelcome)) { hasSeenWelcome = false; } this.Appeared .Where(_ => !hasSeenWelcome) .Take(1) .Subscribe(_ => BlurredAlertView.Display(OAuthWelcome, () => defaultValueService.Set(HasSeenWelcomeKey, true))); }
public override void ViewDidLoad() { base.ViewDidLoad(); LoadRequest(); if (!Core.Settings.HasSeenOAuthWelcome) { Appeared .Take(1) .Do(_ => Core.Settings.HasSeenOAuthWelcome = true) .Subscribe(_ => BlurredAlertView.Display(OAuthWelcome)); } }
public override void ViewDidLoad() { base.ViewDidLoad(); LoadRequest(); bool hasSeenWelcome = false; var defaultValueService = Mvx.Resolve <IDefaultValueService>(); defaultValueService.TryGet(HasSeenWelcomeKey, out hasSeenWelcome); if (!hasSeenWelcome) { Appeared .Take(1) .Subscribe(_ => { defaultValueService.Set(HasSeenWelcomeKey, true); BlurredAlertView.Display(OAuthWelcome); }); } }