﻿<?xml version="1.0" encoding="utf-8"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:media="http://search.yahoo.com/mrss/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0"><channel><title>Intersoft Community - ClientUI - Change NavigationButton uri in code behind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Change-NavigationButton-uri-in-code-behind/</link><description /><generator>http://www.intersoftsolutions.com</generator><language>en</language><copyright>Copyright 2002 - 2015 Intersoft Solutions Corp. All rights reserved.</copyright><ttl>60</ttl><item><title>Change NavigationButton uri in code behind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Change-NavigationButton-uri-in-code-behind/</link><pubDate>Thu, 30 Sep 2010 11:11:24 GMT</pubDate><dc:creator>alagarde</dc:creator><category>ClientUI</category><category>Navigation Button</category><description>&lt;p&gt;I like your answer better than mine.   It is a lot cleaner.&lt;/p&gt;
&lt;p&gt;Thanks again,&lt;/p&gt;
&lt;p&gt;Al&lt;/p&gt;</description></item><item><title>Change NavigationButton uri in code behind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Change-NavigationButton-uri-in-code-behind/</link><pubDate>Thu, 30 Sep 2010 10:44:42 GMT</pubDate><dc:creator>alagarde</dc:creator><category>ClientUI</category><category>Navigation Button</category><description>&lt;p&gt;Jimmy;&lt;/p&gt;
&lt;p&gt;I belive I solved it with this code:&lt;/p&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;
&lt;p&gt;UXNavBtn.CommandParameter = &lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;new&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #2b91af; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #2b91af; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #2b91af; font-size: 13px"&gt;WindowOptions&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;()&lt;p&gt;{&lt;/p&gt;Uri = &lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;new&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #2b91af; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #2b91af; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #2b91af; font-size: 13px"&gt;WindowOptions&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;()
&lt;p&gt;{&lt;/p&gt;
Uri = &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;new&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #2b91af; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #2b91af; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #2b91af; font-size: 13px"&gt;Uri&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #a31515; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #a31515; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #a31515; font-size: 13px"&gt;"/ClientUIBusinessApp1;ClientUIBusinessApp1.Views.Reports.TReportWindow"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #2b91af; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #2b91af; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #2b91af; font-size: 13px"&gt;UriKind&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;.RelativeOrAbsolute),

ForceSingleInstance = &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;false&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;,

ReactivateExistingInstance = &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;false&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;,

&lt;p&gt;WindowHeight = 550,&lt;/p&gt;
&lt;p&gt;WindowWidth = 900&lt;/p&gt;
&lt;p&gt;};&lt;/p&gt;
&lt;p&gt;Thank you for your help.&lt;/p&gt;
&lt;p&gt;Al&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;</description></item><item><title>Change NavigationButton uri in code behind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Change-NavigationButton-uri-in-code-behind/</link><pubDate>Thu, 30 Sep 2010 09:53:06 GMT</pubDate><dc:creator>jimmyps</dc:creator><category>ClientUI</category><category>Navigation Button</category><description>&lt;p&gt;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.&lt;br /&gt;&lt;/p&gt;&lt;p&gt;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).&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;Here's an example of how you can do the casting and set the Uri.&lt;/p&gt;&lt;pre&gt;// cast the command parameter to WindowOptions&lt;br /&gt;WindowOptions options = UXNavBtn.CommandParameter as WindowOptions;
// modify only the Uri of the window options&lt;br /&gt;options.Uri = new Uri(""/ClientUIBusinessApp1;ClientUIBusinessApp1.Views.Reports.TReportWindow", UriKind.RelativeOrAbsolute");&lt;/pre&gt;
&lt;p&gt;Let me know if that works for you.&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Change NavigationButton uri in code behind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Change-NavigationButton-uri-in-code-behind/</link><pubDate>Thu, 30 Sep 2010 08:07:51 GMT</pubDate><dc:creator>alagarde</dc:creator><category>ClientUI</category><category>Navigation Button</category><description>&lt;p&gt;How do I add the window height and width to this?&lt;/p&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;
&lt;p&gt;UXNavBtn.CommandParameter = &lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #0000ff; font-size: 13px"&gt;new&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt; &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #2b91af; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #2b91af; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #2b91af; font-size: 13px"&gt;Uri&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;(&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #a31515; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #a31515; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #a31515; font-size: 13px"&gt;"/ClientUIBusinessApp1;ClientUIBusinessApp1.Views.Reports.TReportWindow"&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;, &lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; color: #2b91af; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #2b91af; font-size: 13px"&gt;&lt;span style="font-family: consolas; color: #2b91af; font-size: 13px"&gt;UriKind&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;&lt;span style="font-family: consolas; font-size: 13px"&gt;.RelativeOrAbsolute);&lt;/span&gt;&lt;/span&gt;&lt;/p&gt;&lt;/span&gt;&lt;/span&gt;</description></item><item><title>Change NavigationButton uri in code behind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Change-NavigationButton-uri-in-code-behind/</link><pubDate>Wed, 29 Sep 2010 13:52:52 GMT</pubDate><dc:creator>alagarde</dc:creator><category>ClientUI</category><category>Navigation Button</category><description>&lt;p&gt;Jimmy;&lt;/p&gt;
&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Thanks,&lt;/p&gt;
&lt;p&gt;Al&lt;/p&gt;</description></item><item><title>Change NavigationButton uri in code behind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Change-NavigationButton-uri-in-code-behind/</link><pubDate>Wed, 29 Sep 2010 08:49:25 GMT</pubDate><dc:creator>jimmyps</dc:creator><category>ClientUI</category><category>Navigation Button</category><description>&lt;p&gt;Al,&lt;/p&gt;&lt;p&gt;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.&lt;/p&gt;
&lt;p&gt;You can try one of the following code to change the navigation uri in code behind:&lt;/p&gt;&lt;pre&gt;uxNavButton1.NavigateUri = new Uri("/Home", UriKind.RelativeOrAbsolute);
// or
uxNavButton1.CommandParameter = new Uri("/Home", UriKind.RelativeOrAbsolute&lt;/pre&gt;
&lt;p&gt;Let me know if that works for you.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Change NavigationButton uri in code behind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Change-NavigationButton-uri-in-code-behind/</link><pubDate>Wed, 29 Sep 2010 04:11:44 GMT</pubDate><dc:creator>niven</dc:creator><category>ClientUI</category><category>Navigation Button</category><description>&lt;p&gt;Hi Alfred,&lt;/p&gt;
&lt;p&gt;I have attach a sample of your wanted scenario.&lt;/p&gt;
&lt;p&gt;Set the UXPage1.xaml as the start page on your App.xaml. Look into the UXPage1ViewModel where I set the binding.&lt;/p&gt;
&lt;p&gt;Hope this can solve your scenario.&lt;/p&gt;
&lt;p&gt;Have a nice day.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Niven Prasetya&lt;/p&gt;</description></item><item><title>Change NavigationButton uri in code behind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Change-NavigationButton-uri-in-code-behind/</link><pubDate>Tue, 28 Sep 2010 13:01:33 GMT</pubDate><dc:creator>alagarde</dc:creator><category>ClientUI</category><category>Navigation Button</category><description>&lt;p&gt;Niven;&lt;/p&gt;
&lt;p&gt;Thanks for your answer.  It is the syntax on the right side of the equation that is giving me trouble.&lt;/p&gt;
&lt;p&gt;Al&lt;/p&gt;</description></item><item><title>Change NavigationButton uri in code behind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Change-NavigationButton-uri-in-code-behind/</link><pubDate>Tue, 28 Sep 2010 05:02:20 GMT</pubDate><dc:creator>niven</dc:creator><category>ClientUI</category><category>Navigation Button</category><description>&lt;p&gt;Hi Alfred,&lt;/p&gt;
&lt;p&gt;Please use the following syntax inside the &lt;strong&gt;UXNavigationButton1_Click&lt;/strong&gt; event handler.&lt;/p&gt;&lt;pre&gt;uXNavigationButton1.CommandParameter = obj ;&lt;/pre&gt;

&lt;p&gt;Hopw this solve your issue.&lt;/p&gt;
&lt;p&gt; &lt;/p&gt;
&lt;p&gt;Best regards,&lt;/p&gt;
&lt;p&gt;Niven Prasetya&lt;/p&gt;</description></item><item><title>Change NavigationButton uri in code behind</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Change-NavigationButton-uri-in-code-behind/</link><pubDate>Mon, 27 Sep 2010 15:18:03 GMT</pubDate><dc:creator>alagarde</dc:creator><category>ClientUI</category><category>Navigation Button</category><description>&lt;p&gt;What is the syntax to change the uri for a NavigationButton.CommandParameter when the UXNavigationButton is clicked?&lt;/p&gt;</description></item></channel></rss>