-
Notifications
You must be signed in to change notification settings - Fork 358
/
Copy pathINavigationService.cs
54 lines (42 loc) · 1.66 KB
/
INavigationService.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.
using Microsoft.UI.Xaml.Controls;
using Microsoft.UI.Xaml.Navigation;
namespace DevHome.Common.Services;
public interface INavigationService
{
event NavigatedEventHandler Navigated;
bool CanGoBack
{
get;
}
// Used to pass data between view models during a navigation
object? LastParameterUsed
{
get;
}
Frame? Frame
{
get; set;
}
string DefaultPage
{
get; set;
}
bool NavigateTo(string pageKey, object? parameter = null, bool clearNavigation = false);
bool GoBack();
bool GoForward();
}
// Expose known page keys so that a project doesn't need to include a ProjectReference to another project
// just to navigate to another page.
public static class KnownPageKeys
{
public static readonly string Dashboard = "DevHome.Dashboard.ViewModels.DashboardViewModel";
public static readonly string Extensions = "DevHome.ExtensionLibrary.ViewModels.ExtensionLibraryViewModel";
public static readonly string Settings = "DevHome.Settings.ViewModels.SettingsViewModel";
public static readonly string Feedback = "DevHome.Settings.ViewModels.FeedbackViewModel";
public static readonly string Environments = "DevHome.Environments.ViewModels.LandingPageViewModel";
public static readonly string SetupFlow = "DevHome.SetupFlow.ViewModels.SetupFlowViewModel";
// Will not work with navigation service natively. Used for the dictionary in SetupFlowViewModel
public static readonly string RepositoryConfiguration = "RepositoryConfiguration";
}