Esempio n. 1
0
        private async void ReceiveButton_Click(object sender, RoutedEventArgs e)
        {
            try
            {
                WebServiceClient        client = new WebServiceClient();
                List <MoneyTransferred> ListOfMoneyTransferred = await client.GetWhoOwesWhoAsync();

                StringBuilder TextBoxString = new StringBuilder();
                foreach (MoneyTransferred moneyTransferred in ListOfMoneyTransferred)
                {
                    TextBoxString.AppendLine("" + moneyTransferred);
                }
                Window newWindow = new Window();
                newWindow.Height = 300;
                newWindow.Width  = 350;
                StackPanel stackPanel = new StackPanel {
                    Orientation = Orientation.Vertical
                };
                stackPanel.Children.Add(new TextBlock {
                    Text = TextBoxString.ToString()
                });
                newWindow.Content = stackPanel;
                newWindow.Show();
            }
            catch (Exception) { MessageBox.Show("Error Occurred"); }
        }