예제 #1
0
        public void Execute(ResultExecutionContext context)
        {
            var proxy = new MoneyServiceClient();

            proxy.GetAllAccountsCompleted += (s, e) =>
            {
                if (e.Error != null)
                {
                    Caliburn.PresentationFramework.Invocation.Execute.OnUIThread(
                        () => Completed(this, new ResultCompletionEventArgs {
                        Error = e.Error
                    }));
                }
                else
                {
                    Accounts = e.Result;
                    Caliburn.PresentationFramework.Invocation.Execute.OnUIThread(() => Completed(this, new ResultCompletionEventArgs()));
                }
            };

            proxy.GetAllAccountsAsync(userId: userId);
        }
예제 #2
0
        private async void Button_Click_1(object sender, RoutedEventArgs e)
        {
            var serviceUrl = ServiceUrl.Text;
            var service    = new MoneyServiceClient();

            service.ClientCredentials.UserName.UserName = Username.Text;
            service.ClientCredentials.UserName.Password = Password.Text;

            SetupServiceUri(service.Endpoint, serviceUrl);

            var accountsResult = await service.GetAllAccountsAsync();

            Frame.Navigate(typeof(GroupedItemsPage), accountsResult);

/*
 *              new SampleDataGroup(
 *              "AllGroups",
 *              "Group Title",
 *              accountsResult.First().Name,
 *              string.Empty,
 *              accountsResult.First().Balance.ToString()));
 */
        }