This is how I dealt with this scenario. You will need a behavior like this that will only call your command for a given specific value.
this.WhenAnyValue(vm => vm.SomeProperty)
.Where(sp => sp == null)
.Throttle(TimeSpan.FromSeconds(.25), TaskPoolScheduler.Default)
.Do(_ => Debug.WriteLine($"Refresh the List"))
.InvokeCommand(GetList)
.DisposeWith(SubscriptionDisposables);
SomeProperty
this.SomeProperty = null; // or some value that makes sense
OnAppearing - , ViewModel , ViewModel .
, , , , RxUI, .
OnAppearing , , canExecute ReactiveCommand ReactiveCommand PullToRefresh ( ). makeExecute , , , .
var isInitialized = this.WhenAnyValue(vm => vm.IsInit).Select( _ => _ == false).DistinctUntilChanged();
InitList = ReactiveCommand.CreateFromTask( _ =>
{
}, isInitialized);
RefreshList = ReactiveCommand.CreateFromTask( _ =>
{
});
InitList.ObserveOn(RxApp.MainThreadScheduler).Subscribe(result =>
{
this.IsInit = false
}).DisposeWith(SubscriptionDisposables);
, , ,