﻿<?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 - Using code to Navigate to UXpage or Window</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Using-code-to-Navigate-to-UXpage-or-Window/</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>Using code to Navigate to UXpage or Window</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Using-code-to-Navigate-to-UXpage-or-Window/</link><pubDate>Fri, 21 Sep 2012 06:13:32 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;The ClientUI navigation framework is built around the commanding semantics which allows certain features of the navigation to be executed through declarative definition in the XAML markup. The commanding semantics is also an ideal approach for MVVM pattern development.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;The following code example shows how to navigate to a page using Navigate command assigned in MouseLeftButtonDown of UXCallOut.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;private void SampleControl1_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e)
{
    NavigationCommands.Navigate.Execute(new Uri("/UXPage3", UriKind.RelativeOrAbsolute),
        (UIElement)ISFocusManager.GetFocusedElement());
}&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;This should help.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Using code to Navigate to UXpage or Window</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Using-code-to-Navigate-to-UXpage-or-Window/</link><pubDate>Thu, 20 Sep 2012 06:27:30 GMT</pubDate><dc:creator>Randine</dc:creator><description>&lt;br /&gt;
&lt;p&gt;Thanks for the sample Navigation project, I looked throught the project and included the necessary NavigationServiceProvider classes etc into my project, I am using UXCallOut StylishLabel_MouseLeftButtonDown event to execute &lt;br /&gt;&lt;/p&gt;
&lt;p&gt;NavigationServiceProvider.Navigate(new Uri("/Views/Page.xaml", UriKind.Relative));&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;but nothing happens, the code execute, but placing a breakpoint and stepping through the code reveals the below errors.&lt;/p&gt;
&lt;p&gt;Detail error on the following .&lt;/p&gt;
&lt;p&gt; public static void Navigate(Uri uri)&lt;br /&gt; {&lt;/p&gt;
&lt;p&gt;&lt;br /&gt; NavigationCommands.Navigate.Execute(uri, (UIElement)ISFocusManager.GetFocusedElement());&lt;br /&gt;&lt;br /&gt; }&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&amp;#43;  AbsolutePath 'uri.AbsolutePath' threw an exception of type 'System.InvalidOperationException' string {System.InvalidOperationException}&lt;br /&gt;&lt;/p&gt;&amp;#43;  AbsoluteUri 'uri.AbsoluteUri' threw an exception of type 'System.InvalidOperationException' string {System.InvalidOperationException}&lt;br /&gt;&amp;#43;  DnsSafeHost 'uri.DnsSafeHost' threw an exception of type 'System.InvalidOperationException' string {System.InvalidOperationException}&lt;br /&gt;&amp;#43;  Fragment 'uri.Fragment' threw an exception of type 'System.InvalidOperationException' string {System.InvalidOperationException}&lt;br /&gt;&amp;#43;  Host 'uri.Host' threw an exception of type 'System.InvalidOperationException' string {System.InvalidOperationException}&lt;br /&gt;  IsAbsoluteUri false bool&lt;br /&gt;&amp;#43;  IsUnc 'uri.IsUnc' threw an exception of type 'System.InvalidOperationException' bool {System.InvalidOperationException}&lt;br /&gt;&amp;#43;  LocalPath 'uri.LocalPath' threw an exception of type 'System.InvalidOperationException' string {System.InvalidOperationException}&lt;br /&gt;  OriginalString "/EcoRating" string&lt;br /&gt;&amp;#43;  Port 'uri.Port' threw an exception of type 'System.InvalidOperationException' int {System.InvalidOperationException}&lt;br /&gt;&amp;#43;  Query 'uri.Query' threw an exception of type 'System.InvalidOperationException' string {System.InvalidOperationException}&lt;br /&gt;&amp;#43;  Scheme 'uri.Scheme' threw an exception of type 'System.InvalidOperationException' string {System.InvalidOperationException}&lt;br /&gt;  UserEscaped false bool&lt;br /&gt;&amp;#43;  UserInfo 'uri.UserInfo' threw an exception of type 'System.InvalidOperationException' string {System.InvalidOperationException}&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;The XML page cannot be displayed 

&lt;p style="font: 8pt/11pt verdana;"&gt;Cannot view XML input using style sheet. 
Please correct the error and then click the &lt;a target="_self"&gt;Refresh&lt;/a&gt; button, or try 
again later. &lt;/p&gt;&lt;br /&gt;
&lt;p style="font: bold 8pt/11pt verdana;"&gt;Invalid at the top level of the document. 
Error processing resource 
'file:///C:/Users/Randine/AppData/Local/Temp/VSD1.tmp.X...&lt;/p&gt;&lt;pre style="line-height: 12pt; font-variant: normal; font-style: normal; font-size: 10pt; font-weight: normal;"&gt;&lt;span style="color: blue;"&gt;/Views/Page.xaml
&lt;/span&gt;&lt;/pre&gt;&lt;br /&gt;&lt;br /&gt;
&lt;p&gt;Help..&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
</description></item><item><title>Using code to Navigate to UXpage or Window</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Using-code-to-Navigate-to-UXpage-or-Window/</link><pubDate>Tue, 18 Sep 2012 06:55:30 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I enclosed a simple sample project which shows how to navigate to a page using button click action. The sample project is created using “Intersoft ClientUI Basic Navigation Application (Minimalist)” project template.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;In the MainPage.xaml, I added UXNavigationButton. When clicked, this button will navigate to About2.xaml page. This action is handled on the click event of the button (see UXNavigationButton_Click function in MainPage.xaml.cs file).&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;I enclosed the sample project as attachment. Please have the attached sample evaluated on your end and let us hear your feedback.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Using code to Navigate to UXpage or Window</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Using-code-to-Navigate-to-UXpage-or-Window/</link><pubDate>Mon, 17 Sep 2012 05:10:48 GMT</pubDate><dc:creator>Randine</dc:creator><description>Hello much appreciated for your comment abot using commands, but in this instant I am not building any index of of any kind, I am using this because I like the UXCallOut which is really cool.&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Still having some errors as I mentioned I am a beginner at this, I get the below error on the code I am using.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;this.NavigationService.Navigate((new Uri("/SilverLightDatabaseExample;Views/Menu.xaml", UriKind.Relative)));&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;The error:Object reference not set to an instance of an object.&lt;/p&gt;
&lt;p&gt;NullReferenceException was unhandled by user code.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt;Please clarify?&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;</description></item><item><title>Using code to Navigate to UXpage or Window</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Using-code-to-Navigate-to-UXpage-or-Window/</link><pubDate>Mon, 17 Sep 2012 02:21:58 GMT</pubDate><dc:creator>yudi</dc:creator><description>&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Actually, there is nothing wrong with your approach to use MouseLeftButtonDown event. However, please allow me to suggest you to use Commands instead of event in Silverlight/WPF project which uses MVVM pattern.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Following is an example why does Commands will helps you better. Suppose a developer create a phone book Silverlight/WPF project. The project is used to helps user to store, display, and find/search contact numbers.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;In the main page, 26 buttons are added. Each button represents an alphabet, from A to Z. When user clicks button “A”, the contact information which start with letter A will be displayed. Plus a button to show all contact information.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;If we use button click event for such scenario, we’ll have to handle 27 button click events. With Commands, we can bind all of the buttons to a single Command. For more detail information about “Commanding Overview and Why Use Commands?” topic, please check the documentation in &lt;a href="http://www.intersoftpt.com/Support/ClientUI/Docs/CommandingOverview.html"&gt;here&lt;/a&gt;.&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;The snippet code below shows how to navigate to UXPage using NavigationCommands.&lt;/span&gt;&lt;/p&gt;&lt;pre&gt;NavigationServiceProvider.Navigate(new Uri("/Blank", UriKind.Relative));&lt;/pre&gt;
&lt;p&gt;&lt;span style="color: rgb(31, 73, 125);"&gt;Hope this helps.&lt;/span&gt;&lt;/p&gt;</description></item><item><title>Using code to Navigate to UXpage or Window</title><link>http://www.intersoftsolutions.com/Community/ClientUI/Using-code-to-Navigate-to-UXpage-or-Window/</link><pubDate>Sun, 16 Sep 2012 17:56:26 GMT</pubDate><dc:creator>Randine</dc:creator><description>&lt;p&gt;Am new to c# and would like to use the MouseLeftButtonDown="StylishLabel_MouseLeftButtonDown" on UXCallOut to open a xaml window in my view folder using code.&lt;/p&gt;
&lt;p&gt;&lt;br /&gt;&lt;/p&gt;
&lt;p&gt; private void StylishLabel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e)&lt;br /&gt; {&lt;br /&gt;   // What code would i place in here to do that please?&lt;br /&gt; &lt;br /&gt;&lt;br /&gt; }&lt;br /&gt;&lt;/p&gt;</description></item></channel></rss>