i have 3 pages
- page 1 is payment details pages where there are 2 buttons (cash ,credit) .this page displays grand
total of all cart products.
- page 2 opens when user clicks on cash button to pay through cash
- page 3 opens when user clicks on credit button to pay through credit
user has choices to complete payment.
- choice 1 is to pay full payment through cash
- choice 2 is to pay full payment through credit
- choice 3 is to pay some payment through cash and some payment through credit
what i have tried till now is when user clicks on cash or credit button he has to pay full payment through one (cash or credit) if user enters full payment user is automatically navigated to page 1 (payment detail page) otherwise it shows an error.
now the problem begins here!!!!!!!!!!
now here i want 2 things
- when navigated to page 1 ,here i want to show all amounts grandtotal ,cash and credit (like i want 3 label 1st to show grand total of cart ,2nd to show amount payed with cash (if payed otherwise zero) ,3rd and vice versa with credit).
- other thing is what i want is page should not be navigated to page 1 until and unless sum of both(cash and credit) is not equal to grand total of cart items
(like grand total(1000rupees)=cash(600rupees)+credit(400rupees))
or
(like grand total(1000rupees)=cash(1000rupees)+credit(0rupees))
if anyone of the above conditions is true then navigated to page 1 and diplay results otherwise show error.
In Xamarin.FormstThere is a very simple way (MessagingCenter) to pass values
The MessagingCenter class provides multicast publish-subscribe functionality.
Publishers send messages using the MessagingCenter.Send
(where you want to pass parameter) method, while subscribers listen for messages using the MessagingCenter.Subscribe
(here in your previous page) method.