how to maintain Login name throughout the application?

Topics: Prism v4 - WPF 4
Jun 6, 2013 at 10:50 AM
Hi,

we have create an application using prism with login page and l we have an application using prism with login page. Login id should maintain throughout the application. when i navigate using request navigate i have passed id through query string. when i returned from one page to another page it will return as null.

can any one help to solve this problem through maintain the login id through out application?

Regards,
Raj.
Jun 6, 2013 at 5:47 PM
Hi,

Based on my understanding, to maintain your Login name accessible throughout all your application, you can use a Shared Service to store it instead of passing it through navigation. Therefore, this Shared Service will be referenced in your application Modules so they can access the info stored in it. For more information about Shared Services, you can go to the following section of the Prism documentation:

I hope you find this useful,

Federico Martinez
http://blogs.southworks.net/fmartinez
Jun 6, 2013 at 5:58 PM
Hi Federico,
                 Thanks for your solution. I met an another issue in Navigation. when navigated callback from one usercontrol to another usercontrol by means of 
RequestNavigation an object is initialized. I tried to stop by putting false in IsNavigationTarget method which is from INavigationAware. but still object is automatically

created and it resides in region itself. can please help me by providing a sample to solve this issue?




Reegan Lourduraj.
Jun 6, 2013 at 6:11 PM
Hi,

I'm not understanding the problem you are facing. If could be helpful if you could describe the problem in more detail.

Regards,

Federico Martinez
http://blogs.southworks.net/fmartinez
Jun 6, 2013 at 6:24 PM
You can see the code of one approach at:

http://blogs.southworks.net/gmaliandi/2011/10/authentication-and-role-based-authorization-in-prism-v4/

See the code, referenced in the article. He uses a service to keep the user name
Jun 6, 2013 at 6:46 PM
Edited Jun 6, 2013 at 6:50 PM
Hi Federico,
            i have three usercontrols in my prism. when i navigate from one usercontrol to another usercontrol in forward 
region it works fine for me. when i navigate back from present to previous user control an object is initializing and it is

automatically storing in Region Views. I am using Request Navigate to navigate from one usercontrol to another

usercontrol. can you provide me a sample in WPF to solve my issue?. Otherwise, please provide a sample for navigation

with both forward and backward navigation?

Thanks,
Reegan.
Jun 7, 2013 at 5:49 PM
Hi,

Based on your scenario, I think that you might find useful the View-Switching Navigation Quickstart from Prism since it uses RequestNavigate to go back and forth between the views.

If this doesn't come to help you, it would be useful if you can provide us with a sample of your application or what you are trying to achieve so we can dig further into the issue you are facing.

Regards,

Federico Martinez
http://blogs.southworks.net/fmartinez