Пример #1
0
 async Task OnSelect(Stock currStock)
 {
     if (!string.Equals(currStock.Symbol, SelectedStock?.Symbol))
     {
         SelectedStock = currStock;
         await SelectedStockChanged.InvokeAsync(SelectedStock);
     }
 }
Пример #2
0
        protected override async Task OnInitializedAsync()
        {
            await ToggleColumnsInitial();

            Data = await StocksListService.GetStocks(true);

            UncategorizedStocks = await StocksListService.GetStocks(false);

            SelectedStock = Data.FirstOrDefault();
            await SelectedStockChanged.InvokeAsync(SelectedStock);

            await base.OnInitializedAsync();
        }
Пример #3
0
        async Task OnRemoveConfirm()
        {
            if (SelectedStock == null)
            {
                return;
            }

            var stockForRemove = Data.FirstOrDefault(c => c.Symbol == SelectedStock.Symbol);
            await StocksListService.RemoveStock(stockForRemove);

            Data = await StocksListService.GetStocks(true);

            UncategorizedStocks = await StocksListService.GetStocks(false);

            SelectedStock = Data.FirstOrDefault();
            await SelectedStockChanged.InvokeAsync(SelectedStock);
        }
Пример #4
0
 async Task OnSelect(IEnumerable <Stock> selectedStocks)
 {
     SelectedStock = selectedStocks.FirstOrDefault();
     await SelectedStockChanged.InvokeAsync(SelectedStock);
 }