Exemple #1
0
        private async void Send()
        {
            var account = App.AtomexApp.Account;

            try
            {
                App.DialogService.Show(new SendingViewModel());

                var error = await account
                            .SendAsync(Currency.Name, To, Amount, Fee, FeePrice, UseDeafultFee);

                if (error != null)
                {
                    App.DialogService.Show(MessageViewModel.Error(
                                               text: error.Description,
                                               backAction: () => Desktop.App.DialogService.Show(this)));

                    return;
                }

                App.DialogService.Show(MessageViewModel.Success(
                                           text: "Sending was successful",
                                           nextAction: () => { App.DialogService.CloseDialog(); }));
            }
            catch (Exception e)
            {
                App.DialogService.Show(MessageViewModel.Error(
                                           text: "An error has occurred while sending transaction.",
                                           backAction: () => App.DialogService.Show(this)));

                Log.Error(e, "Transaction send error.");
            }
        }
        private async void Send()
        {
            var account = App.AtomixApp.Account;

            try
            {
                Navigation.Navigate(uri: Navigation.SendingAlias);

                var error = await account
                            .SendAsync(Currency, To, Amount, Fee, FeePrice);

                if (error != null)
                {
                    Navigation.Navigate(
                        uri: Navigation.MessageAlias,
                        context: MessageViewModel.Error(
                            text: error.Description,
                            goBackPages: 2));
                    return;
                }

                Navigation.Navigate(
                    uri: Navigation.MessageAlias,
                    context: MessageViewModel.Success(
                        text: "Sending was successful",
                        nextAction: () => { DialogViewer?.HideSendDialog(); }));
            }
            catch (Exception e)
            {
                Navigation.Navigate(
                    uri: Navigation.MessageAlias,
                    context: MessageViewModel.Error(
                        text: "An error has occurred while sending transaction.",
                        goBackPages: 2));

                Log.Error(e, "Transaction send error.");
            }
        }