-
Notifications
You must be signed in to change notification settings - Fork 0
/
App.xaml.cs
38 lines (33 loc) · 1.08 KB
/
App.xaml.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
using AppShortcutsSample.Views;
using System;
using AppShortcutsSample.Services;
using Xamarin.Forms;
namespace AppShortcutsSample
{
public partial class App : Application
{
public const string AppShortcutUriBase = "stc://staticshortcuts/";
private const string ShortcutKey_Favorite = "favorites";
public App()
{
InitializeComponent();
MainPage = new MasterDetailPage
{
Master = new MenuPage(),
Detail = new NavigationPage(new MainPage())
{
BarBackgroundColor = Color.FromHex("#252C35"),
BarTextColor = Color.White
}
};
}
protected override async void OnAppLinkRequestReceived(Uri uri)
{
var shortcutKey = uri.ToString().Replace(AppShortcutUriBase, "");
if (shortcutKey == ShortcutKey_Favorite)
await NavigationService.Instance.Navigate(new FavoritesPage());
else
base.OnAppLinkRequestReceived(uri);
}
}
}