-
Notifications
You must be signed in to change notification settings - Fork 32
/
FlexFlyoutPage.cs
42 lines (37 loc) · 1.45 KB
/
FlexFlyoutPage.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
using System;
using Flexibility.Shared.Models;
using Xamarin.Forms;
using Xamarin.Forms.PlatformConfiguration.iOSSpecific;
namespace Flexibility.Shared
{
public class FlexFlyoutPage :
Xamarin.Forms.FlyoutPage
{
MenuPage menuPage;
public FlexFlyoutPage()
{
menuPage = new MenuPage();
Flyout = menuPage;
Detail = new Xamarin.Forms.NavigationPage(new LoginPage()){
BarBackgroundColor = Color.FromHex("#16222a"),
BarTextColor = Color.FromHex("#F1F1F1")
};
(Detail as Xamarin.Forms.NavigationPage).On<Xamarin.Forms.PlatformConfiguration.iOS>().SetPrefersLargeTitles(true);
menuPage.Menu.ItemSelected += OnItemSelected;
}
private void OnItemSelected(object sender, SelectedItemChangedEventArgs e)
{
var item = e.SelectedItem as MasterPageItem;
if (item != null)
{
Detail = new Xamarin.Forms.NavigationPage((Xamarin.Forms.Page)Activator.CreateInstance(item.TargetType)){
BarBackgroundColor = Color.FromHex("#16222a"),
BarTextColor = Color.FromHex("#ccc")
};
(Detail as Xamarin.Forms.NavigationPage).On<Xamarin.Forms.PlatformConfiguration.iOS>().SetPrefersLargeTitles(true);
menuPage.Menu.SelectedItem = null;
IsPresented = false;
}
}
}
}