void displayActionPage(string actionSelected)
        {
            var action = App.ViewModel.Contract.Functions.Where(a => a.DisplayName == actionSelected).FirstOrDefault();

            var parameterCount = action.Parameters.Count();

            //Show a popup page if theres 3 parameters or less
            if (parameterCount < 3)
            {
                var actionPopupPage = new ActionPopupPage(action, App.ViewModel.AllUsersList, ViewModel.ContractInstance);

                actionPopupPage.ContractActionSucceded += async(_s, _e) =>
                {
                    ViewModel.DisplayActions = false;
                    await RunAnimation();
                };

                Device.BeginInvokeOnMainThread(async() =>
                {
                    await Navigation.PushPopupAsync(actionPopupPage);
                });
            }
            else
            {
                var actionPopupPage = new ContractActionPage(action, App.ViewModel.AllUsersList, ViewModel.ContractInstance);

                actionPopupPage.ContractActionSucceded += async(_s, _e) =>
                {
                    ViewModel.DisplayActions = false;
                    await RunAnimation();
                };

                Navigation.PushAsync(actionPopupPage);
            }
        }
Пример #2
0
        async Task addNewContractAsync()
        {
            var contractDefinitionSelected = App.ViewModel.Contract;

            if (contractDefinitionSelected is null)
            {
                return;
            }

            var contractAction = contractDefinitionSelected.Constructor;

            if (ViewModel.IsUserInitiator)
            {
                //TODO: CONNECTION ID IS FORCED
                var newContractPage = new ContractActionPage(contractAction, App.ViewModel.AllUsersList, contractDefinitionSelected.Id.ToString(), "1");
                newContractPage.ContractActionSucceded += (_s, _e) => RunAnimation();

                await Navigation.PushAsync(newContractPage);
            }
        }