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
namespace ClientUIWPFNavApp1.Views { public partial class Settings : UXPage { public Settings() { InitializeComponent(); } // Executes when the user navigates to this page. protected override void OnNavigatedTo(NavigationEventArgs e) { if (e.ExtraData != null) { Console.WriteLine("OnNavigatedTo | e.ExtraData != null | Success!!"); } else { Console.WriteLine("OnNavigatedTo | e.ExtraData == null | Failed!!"); } } } }
ExtraData is always null.
I'm putting together a single sign on, and this is preventing the login page from redirecting to the RequiresAuthentication="True" page on a good authentication.
Any help would be appreciated.
Thanks in advance,
Alastair
Hi Alastair,
Did you use navigate function to pass extra data ?
I have replicated your issue (using navigate function). I already forwarded this issue to our development team to be investigated further. I'll tell you soon when I get the update from them.
Regards,
Riendy
Thanks for the quick response Riendy.
I didn't explicitly call the navigate function to pass the extradata, simply implemented OnNavigatedTo in the navigatedto page.
Is there a way to catch the 'about to navigate' on the source page, and add the extradata myself? That would work for me.
All the best,
Hi Jimmy,
I've attached a full sample. It's the vanilla Navigation app with authentication added. I picked apart the Silverlight samples and an earlier custom authentication sample on the boards. The examples are great by the way...
The authentication manager accepts "user" and "password" as a good credential. This is just for the example, obviously the backend authentication will be slightly stronger..;)
The settings page is set to require authentication: RequiresAuthentication="True"
When we navigate to Settings first time around, the LoginForm is invoked to get the credential. If this is successful, we return to the Home page, as the ExtraData doesn't contain the URI of the Settings page that invoked the form.
public partial class LoginForm : UXPage { public LoginForm() { InitializeComponent(); } // Executes when the user navigates to this page. protected override void OnNavigatedTo(NavigationEventArgs e) { // Get a reference to the NavigationService that navigated to this Page // If the login page was redirected from a protected page, // the e.ExtraData will include the URI of the original caller page. if (e.ExtraData != null && e.ExtraData is NavigationOptions) { // bind the URI to our view model, so we can redirect back // to the original page when the login succeeded. LoginFormViewModel viewModel = this.DataContext as LoginFormViewModel; viewModel.OriginalUri = ((NavigationOptions)e.ExtraData).NavigateUri; } } }
We can then navigate manually to the Settings page, and it displays if the authentication was ok.
I was hoping to drop into the Settings page directly once the authentication is good:
if (loginOperation.LoginSuccess) { // Login success, navigate to the page that originally requesting access // need to make ui calls on same thread as ui (sta threading model) // callback is created as a different thread // http://stackoverflow.com/questions/351676/problem-using-multithreading-with-simple-wpf-app System.Windows.Application.Current.Dispatcher.Invoke(new System.Action(() => { NavigationServiceProvider.Navigate(this.OriginalUri); })); }
It's the OriginalUri not being set to SettingsPage because of no ExtraData. So we default to Home.
I'm pretty new to WPF - and as I said - ClientUI is an excellent product and making my life a lot easier. But I may have missed something obvious. Is there there a way to override the framework and provide the extra data myself? All the best, Alastair
I'm pretty new to WPF - and as I said - ClientUI is an excellent product and making my life a lot easier. But I may have missed something obvious. Is there there a way to override the framework and provide the extra data myself?
[moved post below]
Hi Jimmy.
Still failing with no ExtraData. I grabbed the nightly from 13th May, sample with DLLs attached. Maybe I'm doing something odd?
Hello Alastair,
Our development team has fixed your issue, and now I want to send the release nightly build to you. Could you please let me know what is your email address?
Thanks Riendy, have emailed you the address.
Appreciate the efforts here folks, thanks.
I've already sent the release nightly build to you.
Please do not hesitate to ask us if you still have any question.
Riendy Setiadi
Works like a dream Riendy - many thanks for this and the quick turnaround.
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