using System; using System.Windows.Controls; using ExcelHelper.Views; namespace ExcelHelper.Services; public class NavigationService { private Frame _frame; public static string currentView; public void InitForFrame(Frame frame) { _frame = frame; } public void NavigateTo() { var target = App.AppHost.Get(); if (target is IView page) { currentView = typeof(T).Name; _frame.NavigationService.Navigate(page); } } public void NavigateTo(Type type) { var target = App.AppHost.Get(type); if (target is IView page) { currentView = type.Name; _frame.NavigationService.Navigate(page); } } }