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
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.
private void StylishLabel_MouseLeftButtonDown(object sender, MouseButtonEventArgs e) { // What code would i place in here to do that please? }
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.
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.
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.
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 here.
The snippet code below shows how to navigate to UXPage using NavigationCommands.
NavigationServiceProvider.Navigate(new Uri("/Blank", UriKind.Relative));
Hope this helps.
Still having some errors as I mentioned I am a beginner at this, I get the below error on the code I am using.
this.NavigationService.Navigate((new Uri("/SilverLightDatabaseExample;Views/Menu.xaml", UriKind.Relative)));
The error:Object reference not set to an instance of an object.
NullReferenceException was unhandled by user code.
Please clarify?
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.
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).
I enclosed the sample project as attachment. Please have the attached sample evaluated on your end and let us hear your feedback.
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
NavigationServiceProvider.Navigate(new Uri("/Views/Page.xaml", UriKind.Relative));
but nothing happens, the code execute, but placing a breakpoint and stepping through the code reveals the below errors.
Detail error on the following .
public static void Navigate(Uri uri) {
NavigationCommands.Navigate.Execute(uri, (UIElement)ISFocusManager.GetFocusedElement()); }
+ AbsolutePath 'uri.AbsolutePath' threw an exception of type 'System.InvalidOperationException' string {System.InvalidOperationException}
Cannot view XML input using style sheet. Please correct the error and then click the Refresh button, or try again later.
Invalid at the top level of the document. Error processing resource 'file:///C:/Users/Randine/AppData/Local/Temp/VSD1.tmp.X...
/Views/Page.xaml
Help..
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.
The following code example shows how to navigate to a page using Navigate command assigned in MouseLeftButtonDown of UXCallOut.
private void SampleControl1_MouseLeftButtonDown(object sender, System.Windows.Input.MouseButtonEventArgs e) { NavigationCommands.Navigate.Execute(new Uri("/UXPage3", UriKind.RelativeOrAbsolute), (UIElement)ISFocusManager.GetFocusedElement()); }
This should help.
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