Given I have about 100 classes in my Prism application project, a project can become difficult to debug for other devs. I am looking for a way to show a toast when a user navigates to any page. This toast message will tell the user the respective view model page title of the current view.
public class AViewModel
{
public override void OnNavigatingTo(INavigationParameters parameters)
{
Toast("AViewModel")
}
}
public class BViewModel
{
public override void OnNavigatingTo(INavigationParameters parameters)
{
Toast("BViewModel")
}
}
public class CViewModel
{
public override void OnNavigatingTo(INavigationParameters parameters)
{
Toast("CViewModel")
}
}
public class DViewModel
{
public override void OnNavigatingTo(INavigationParameters parameters)
{
Toast("DViewModel")
}
}
Im looking to achieve such functionality without actually including Toast("ViewModelName")
in every class. Is there a way I can override something and implement this?