iSeller Commerce
iSeller POS Retail
iSeller POS F&B
iSeller POS Express
Crosslight
WebUI
ClientUI
What's New
Download Trial
Web Solution
Mobile Solution
Enterprise Solution
Custom Development
Blog
Community
Latest Development Blogs
ForumPostTopic
Browse By Tag
Hi,
How do you implement a navigation using CrossLight navigation service, wherein you need to create a login form when the application starts? Say before displaying a DrawerNavigation or Tabbed root viewmodel, we need to authenticate a user. That said, once the user logs in he/she won't be able to go back to the login page unless he/she logs out.
We were thinking of pushing a modal dialog once the rootviewmodel activates, but how do we do that exactly? Creating a modal form on Navigated event via viewmodel throws an argumentexception.
Instead of setting DrawerViewModel or TabbedViewModel as the root view model, you can use your own view model as the login page, for example, LoginViewModel and set it as the root view model in the AppService in the Core PCL project. Then create a new page for each platform that consumes the LoginViewModel, where you can implement your own custom logic and validation for the login process. We are currently creating a business template that streamlines this process for our customers and will be available in the next version of Crosslight.
We suggest to use a dedicated ViewController instead of using a modal dialog for the login form, as this will allow you to manage the login process easily in the view model. However, if you wish to use a modal dialog instead, you can create your own custom presenter and show the presenter right after the Navigated event in the view model. You can see our video in the YouTube channel that shows you how you can introduce your own custom presenters to use in Crosslight.
In my humble opinion, it occurs when the view has already been loaded.
Regards,Handy
I don't think Navigated event is being triggered everytime a view is loaded. There are instances that Navigated are not invoked, especially when you're not passing any data when navigating to a new view.
Hi Domingo,
While you can navigate to any ViewModels in Crosslight v1, there's actually an unsupported scenario where users can still go back to the previous screen which is undesirable for "login" to "main page" scenario.
The good news is that we've a new feature in v2 called Navigation to Root View feature. We've make this really easy to implement which allows you to continue using NavigationService.Navigate as usual. All you need to do later is simply adding IsRootView="true" property in the RegisterNavigation of the particular view that should be treated as root. When navigation service encounters such attribute, it will set the view as root, and automatically prevent users to go back to the previous screen. There are no extra code needed in your side to handle the "back" behavior and so on.
We're currently in final sprints of Crosslight v2 features, and we expect to roll out v2 very soon. Please bear with us for a while.
or
Choose this if you're already a member of Intersoft Community Forum. You can link your OpenID account to your existing Intersoft Social ID.
Choose this if you don't have an Intersoft account yet. Your authenticated OpenID will be automatically linked to your new Intersoft account.
Enter your Wordpress Blogname