public DataRefresher() { CategoryService = Locator.Current.GetService <CategoryService>(); ShoppingItemService = Locator.Current.GetService <ShoppingItemService>(); MealItemService = Locator.Current.GetService <MealItemService>(); RefreshAll = ReactiveCommand.Create <Unit, long>((_) => { return(DateTime.Now.Ticks); }); Disposables.Add(RefreshAll.Select(_ => Unit.Default).InvokeCommand(this, x => x.CategoryService.Refresh)); Disposables.Add(RefreshAll.Select(_ => Unit.Default).InvokeCommand(this, x => x.ShoppingItemService.Refresh)); Disposables.Add(RefreshAll.Select(_ => Unit.Default).InvokeCommand(this, x => x.MealItemService.Refresh)); }
/// <summary> /// Handles the message. /// </summary> /// <param name="message">The message.</param> public void Handle(RefreshAll message) { RefreshData(); }