-
Notifications
You must be signed in to change notification settings - Fork 57
Expand file tree
/
Copy pathAppShell.xaml.cs
More file actions
37 lines (28 loc) · 1010 Bytes
/
AppShell.xaml.cs
File metadata and controls
37 lines (28 loc) · 1010 Bytes
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
using Sample.SimpleShell.Views.Pages;
using SimpleToolkit.SimpleShell.Extensions;
namespace Sample.SimpleShell;
public partial class AppShell : SimpleToolkit.SimpleShell.SimpleShell
{
public AppShell()
{
InitializeComponent();
Routing.RegisterRoute(nameof(YellowDetailPage), typeof(YellowDetailPage));
this.SetTransition(Transitions.CustomPlatformTransition);
}
private void OnSafeAreaChanged(Thickness safeAreaPadding)
{
rootContainer.Padding = safeAreaPadding;
}
private async void ShellItemButtonClicked(object sender, EventArgs e)
{
var button = sender as Button;
var shellItem = button.BindingContext as BaseShellItem;
// Navigate to a new tab if it is not the current tab
if (!CurrentState.Location.OriginalString.Contains(shellItem.Route))
await GoToAsync($"///{shellItem.Route}");
}
private async void BackButtonClicked(object sender, EventArgs e)
{
await GoToAsync("..");
}
}