Solved

WPF Application page navigation

Posted on 2010-09-14
8
589 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…
Introduction When many people think of the WebBrowser (http://msdn.microsoft.com/en-us/library/2te2y1x6%28v=VS.85%29.aspx) control, they immediately think of a control which allows the viewing and navigation of web pages. While this is true, it's a…
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…
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

911 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

19 Experts available now in Live!

Get 1:1 Help Now