public HomePage() { InitializeComponent(); BindingContext = viewModel = new HomePageViewModel(); ModalOverlay.BackgroundColor = Color.FromRgba(0, 0, 0, 0.5); _liquidationCategoryService = DependencyService.Get <ILiquidationCategoryService>(); MessagingCenter.Subscribe <AddLiquidationPage>(this, "OnSaveItem", async(sender) => await viewModel.LoadLiquidationList()); MessagingCenter.Subscribe <LiquidationDetailPage, Guid>(this, "OnDeleted", async(sender, liquidationId) => { if (viewModel.Type0List.Any(x => x.Id == liquidationId)) { await viewModel.LoadLiquidationList(); } }); MessagingCenter.Subscribe <AddToDayPage>(this, "OnSaveItem", async(sender) => await viewModel.LoadLiquidationToDayList()); MessagingCenter.Subscribe <PickerLiquidationPage>(this, "OnSaveItem", async(sender) => await viewModel.LoadLiquidationToDayList()); MessagingCenter.Subscribe <ToDayDetailPage, Guid>(this, "OnDeleted", async(sender, todayId) => { if (viewModel.LiquidationToDayList.Any(x => x.Id == todayId)) { await viewModel.LoadLiquidationToDayList(); } }); Init(); }
public async void Init() { await Task.WhenAll(viewModel.LoadLiquidationList(), viewModel.LoadLiquidationToDayList(), viewModel.LoadSlideList(), viewModel.LoadAdvertise()); SetUpSlideImages(); LoadCategories(); loadingPopup.IsVisible = false; }
public async void Init() { await Task.WhenAll(viewModel.LoadNewestBuyOrRentList(), viewModel.LoadNewestNeedtoBuyOrRentList(), viewModel.LoadProjectList(), viewModel.LoadNewFurnitureProducts(), viewModel.LoadLiquidationList()); MessagingCenter.Subscribe <AddLiquidationPage>(this, "OnSaveItem", async(sender) => await viewModel.LoadLiquidationList()); MessagingCenter.Subscribe <LiquidationDetailPage, Guid>(this, "OnDeleted", async(sender, liquidationId) => { if (viewModel.Liquidations.Any(x => x.Id == liquidationId)) { await viewModel.LoadLiquidationList(); } }); loadingPopup.IsVisible = false; }