I have recently begun a learning project using WPF with VB.Net - This is the first time I haven't been able to find the answer I need, apologies if this is basic.
The following webpage describes how to handle navigation events within Modern UI, but I can't get it to work...
In MainWindow:
Public Interface Icontent
Sub OnFragmentNavigation(e As FragmentNavigationEventArgs)
Sub OnNavigatedFrom(e As NavigationEventArgs)
Sub OnNavigatedTo(e As NavigationEventArgs)
Sub OnNavigatingFrom(e As NavigatingCancelEventArgs)
End Interface
In Page:
Public Class Page1
Implements Icontent
Public Sub OnFragmentNavigation(e As FragmentNavigationEventArgs) Implements Icontent.OnFragmentNavigation
Debug.WriteLine("Yes")
End Sub
Public Sub OnNavigatedFrom(e As NavigationEventArgs) Implements Icontent.OnNavigatedFrom
Debug.WriteLine("Yes")
End Sub
Public Sub OnNavigatedTo(e As NavigationEventArgs) Implements Icontent.OnNavigatedTo
Debug.WriteLine("Yes")
End Sub
Public Sub OnNavigatingFrom(e As NavigatingCancelEventArgs) Implements Icontent.OnNavigatingFrom
Debug.WriteLine("Yes")
End Sub
End Class
But the events don't seem to fire. I have tried including the Interface into the FirstFloor.ModernUI.Windows Namespace as follows:
Namespace FirstFloor.ModernUI.Windows
Public Interface Icontent
Sub OnFragmentNavigation(e As FragmentNavigationEventArgs)
Sub OnNavigatedFrom(e As NavigationEventArgs)
Sub OnNavigatedTo(e As NavigationEventArgs)
Sub OnNavigatingFrom(e As NavigatingCancelEventArgs)
End Interface
End Namespace
But again, this doesn't work?
The standard WPF events - I.E. Initialized - work fine.
Thanks in advance!