Need Advice on code structure design for cross plattform workflow

KarlFischer.9375KarlFischer.9375 USMember
edited October 2016 in Cross Platform with Xamarin

I am wondering what would be the most suitable approach for structuring a cross-platform (iOS+Android) code for the following scenario:
In my app the user starts a workflow by clicking an item in the start screen of the app. The workflow then contains a sequence of screens, which accept user inputs/option selections, and depend on the inputs done in the former screens. Aditionally, the content of each screen shall be retreived dynamically from a server-sided API.

So, I want to create a workflow similar to this:
[user clicks start on main screen] --> load data from webserver --> show descision screen 1 --> [user selects from options 1a/1b/1c] --> load data from webserver for e.g. option 1a --> show decision screen 2 --> [user selects from 2a/2b/2c] --> ... --> return to main screen

My idea is to define a general "shared" handler class which contains all the logic basically as a "top-to-bottom" sequence. This handler should be called from the button in the start screen in the respective OS. I thought I could hand the respective context to that handler and use it for showing the several dialogs/screens from there.

I did a quick test so far, without success, but did not go into using e.g. #if Android or so.

Before digging deepter into this I'd like now to get some general advice wether the approach for itself is the "right direction" or not. So - thank you for your thoughts :-)

Sign In or Register to comment.