private void loadShares(String filtervalue, String currencyType, int sortType)
        {
            client = new StockMarketWebService.PurchaseSharesClient();
            lstVwShares.ItemsSource = null;
            clearfields();

            Char[] currency = currencyType.ToCharArray();
            currencyType = currency[0].ToString() + currency[1] + currency[2];
            if (filtervalue == "")
            {
                filtervalue = null;
            }

            companyShares = client.getSharesAsync(filtervalue, currencyType).Result.@return;

            StockMarketWebService.companyShare tempShare = new StockMarketWebService.companyShare();


            for (int i = 0; i < companyShares.Length; i++)
            {
                for (int x = 1; x < (companyShares.Length - i); x++)
                {
                    if (sortType == 0)
                    {
                        if (companyShares[x - 1].sharePrice.value > companyShares[x].sharePrice.value)
                        {
                            tempShare            = companyShares[x - 1];
                            companyShares[x - 1] = companyShares[x];
                            companyShares[x]     = tempShare;
                        }
                    }
                    else if (sortType == 1)
                    {
                        if (companyShares[x - 1].sharePrice.value < companyShares[x].sharePrice.value)
                        {
                            tempShare            = companyShares[x - 1];
                            companyShares[x - 1] = companyShares[x];
                            companyShares[x]     = tempShare;
                        }
                    }
                }
            }
            List <CompanyStock> allCompanyStock = new List <CompanyStock>();

            foreach (StockMarketWebService.companyShare share in companyShares)
            {
                allCompanyStock.Add(new CompanyStock
                {
                    companyName = share.companyName,
                    symbol      = share.companySymbol,
                    volume      = share.numOfAvailShares,
                    currency    = share.sharePrice.currency,
                    value       = share.sharePrice.value,
                    date        = share.sharePrice.dateOfLastUpdate
                });
            }


            lstVwShares.ItemsSource = allCompanyStock;


            //var loopIndex = 10;
            //await ThreadPool.RunAsync(
            //      o =>
            //      {
            //          // This is a background operation!
            //          while (true)
            //          {
            //              client = new StockMarketWebService.PurchaseSharesClient();

            //              lstBxShares.Items.Clear();
            //              //StockMarketWebService.getCurrencyNamesResponse x = await client.getSharesAsync(null, null).Result;
            //              foreach (StockMarketWebService.companyShare company in client.getSharesAsync(null, null).Result.@return)
            //              {
            //                  lstBxShares.Items.Add(company.companyName);

            //              }
            //              System.Threading.Tasks.Task.Delay(2000);
            //          }
            //      });
        }