Solved

WPF Application page navigation

Posted on 2010-09-14
8
582 Views
Last Modified: 2013-11-12
Hi Experts,
I am new to WPF (know windows forms) and still struggling with some of the basics. Please be kind and be very clear with your assistance.
I have created a main window and added a ribbon with buttons.
I now want to open (show) a page (window) based on button click.
On the page I want to get user input and return the values.
Very basic stuff in winforms. Not so easy in WPF (it seems)
I am using Visual Studio 2010 (Visual Basic)
0
Comment
Question by:esps
  • 4
  • 4
8 Comments
 
LVL 2

Expert Comment

by:DmitryVasiliev
ID: 33670565
Hello
You need to use "PageFunction" instead of "Page".
In this case you are able to get result using OnResult event of PageFunction.

See details here:
http://msdn.microsoft.com/en-us/library/ms615540.aspx
http://msdn.microsoft.com/en-us/library/aa349685.aspx
0
 

Author Comment

by:esps
ID: 33672109
Hi
Thank you for your response.

My code is as below, attached find error image:

Class MainWindow
Public ReadOnly Property NavigationService As NavigationService
        Get
        End Get
End Property

Private Sub RibbonButton3_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles RibbonButton3.Click
        Dim pageFunctionUri As New Uri("SetupCriteria.xaml", UriKind.Relative)
        Me.NavigationService.Navigate(pageFunctionUri)
    End Sub
End Class
Capture.PNG
0
 
LVL 2

Expert Comment

by:DmitryVasiliev
ID: 33672440
Use NavigationPage instance as "Navigate" function parameter instead of Uri

Something like

Dim page as New SetupCriteria();
page.OnResult += ResultHandlerFunction;
Me.NavigationService.Navigate(page);
0
 

Author Comment

by:esps
ID: 33673989
Forgive my 'blondness'
I am not winning with the syntax (or something)

Private Sub RibbonButton3_Click(ByVal sender As System.Object, ByVal e As System.Windows.RoutedEventArgs) Handles RibbonButton3.Click
        Dim page As New SetupCriteria()
        page.OnResult += ResultHandlerFunction
        Me.NavigationService.Navigate(page)
        End Sub

Please see image
Untitled.jpg
0
How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

 
LVL 2

Expert Comment

by:DmitryVasiliev
ID: 33674035
Did you define ResultHandlerFunction handler?
0
 

Author Comment

by:esps
ID: 33674956
I am sorry.
This is not helping me.
You are obviously at a different level with this.
Please show me step by step, give me examples or links with specific examples.
regards
0
 
LVL 2

Accepted Solution

by:
DmitryVasiliev earned 500 total points
ID: 33675086
0
 

Author Comment

by:esps
ID: 33679892
Hi
Thank you. This has put me on the right track.
I will be accepting your previous answer as solution.
Please won't you also have a look at a previous question of mine that I am not getting helpful responses on?
ID: 26417220
best regards
0

Featured Post

Maximize Your Threat Intelligence Reporting

Reporting is one of the most important and least talked about aspects of a world-class threat intelligence program. Here’s how to do it right.

Join & Write a Comment

1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

757 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

21 Experts available now in Live!

Get 1:1 Help Now