Пример #1
0
        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));
        }
Пример #2
0
 /// <summary>
 ///     Handles the message.
 /// </summary>
 /// <param name="message">The message.</param>
 public void Handle(RefreshAll message)
 {
     RefreshData();
 }