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
What is the syntax to change the uri for a NavigationButton.CommandParameter when the UXNavigationButton is clicked?
Oh okay, I initially thought you're navigating to a standard UXPage. It's obvious now that you're launching a new window using navigation button, and not navigating to a page.
Based on your description, I also presume that you bind the CommandParameter to a WindowOptions object in the XAML (similar to DesktopDock sample in our Control Samples).
If that is true, then you can cast the CommandParameter to WindowOptions type in your code, then simply set the Uri to a new destination. This will keep your WindowWidth and WindowHeight remaining the same as specified in the XAML.
Here's an example of how you can do the casting and set the Uri.
// cast the command parameter to WindowOptionsWindowOptions options = UXNavBtn.CommandParameter as WindowOptions; // modify only the Uri of the window optionsoptions.Uri = new Uri(""/ClientUIBusinessApp1;ClientUIBusinessApp1.Views.Reports.TReportWindow", UriKind.RelativeOrAbsolute");
Let me know if that works for you.
Jimmy;
I belive I solved it with this code:
UXNavBtn.CommandParameter = new WindowOptions(){Uri =
{
WindowHeight = 550,
WindowWidth = 900
};
Thank you for your help.
Al
Hi Alfred,
Please use the following syntax inside the UXNavigationButton1_Click event handler.
uXNavigationButton1.CommandParameter = obj ;
Hopw this solve your issue.
Best regards,
Niven Prasetya
Niven;
Thanks for your answer. It is the syntax on the right side of the equation that is giving me trouble.
I have attach a sample of your wanted scenario.
Set the UXPage1.xaml as the start page on your App.xaml. Look into the UXPage1ViewModel where I set the binding.
Hope this can solve your scenario.
Have a nice day.
Al,
To set the navigate Uri of a navigation button, you can simply set the NavigateUri in the code behind. Since you're using CommandParameter, I presume you're using MVVM pattern and commanding to perform navigation.
You can try one of the following code to change the navigation uri in code behind:
uxNavButton1.NavigateUri = new Uri("/Home", UriKind.RelativeOrAbsolute); // or uxNavButton1.CommandParameter = new Uri("/Home", UriKind.RelativeOrAbsolute
This is a good solution, but it does remove the WindowHeight and WindowWidth which were declaritively set. Does this approach overwrite all of the declared setting? If so what is the syntax to reset the WindowHeight and WindowWidth in behind code? I tried a few things which have not worked, and will continue to try while a wait for the answer.
Thanks,
How do I add the window height and width to this?
UXNavBtn.CommandParameter = new Uri("/ClientUIBusinessApp1;ClientUIBusinessApp1.Views.Reports.TReportWindow", UriKind.RelativeOrAbsolute);
I like your answer better than mine. It is a lot cleaner.
Thanks again,
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