This repository has been archived by the owner on May 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
/
NavigationPage.cs
125 lines (101 loc) · 4.44 KB
/
NavigationPage.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
namespace Xamarin.Forms.PlatformConfiguration.iOSSpecific
{
using FormsElement = Forms.NavigationPage;
public static class NavigationPage
{
#region Translucent
public static readonly BindableProperty IsNavigationBarTranslucentProperty =
BindableProperty.Create("IsNavigationBarTranslucent", typeof(bool),
typeof(NavigationPage), false);
public static bool GetIsNavigationBarTranslucent(BindableObject element)
{
return (bool)element.GetValue(IsNavigationBarTranslucentProperty);
}
public static void SetIsNavigationBarTranslucent(BindableObject element, bool value)
{
element.SetValue(IsNavigationBarTranslucentProperty, value);
}
public static bool IsNavigationBarTranslucent(this IPlatformElementConfiguration<iOS, FormsElement> config)
{
return GetIsNavigationBarTranslucent(config.Element);
}
public static IPlatformElementConfiguration<iOS, FormsElement> SetIsNavigationBarTranslucent(this IPlatformElementConfiguration<iOS, FormsElement> config, bool value)
{
SetIsNavigationBarTranslucent(config.Element, value);
return config;
}
public static IPlatformElementConfiguration<iOS, FormsElement> EnableTranslucentNavigationBar(this IPlatformElementConfiguration<iOS, FormsElement> config)
{
SetIsNavigationBarTranslucent(config.Element, true);
return config;
}
public static IPlatformElementConfiguration<iOS, FormsElement> DisableTranslucentNavigationBar(this IPlatformElementConfiguration<iOS, FormsElement> config)
{
SetIsNavigationBarTranslucent(config.Element, false);
return config;
}
#endregion
#region StatusBarTextColorMode
public static readonly BindableProperty StatusBarTextColorModeProperty =
BindableProperty.Create("StatusBarColorTextMode", typeof(StatusBarTextColorMode),
typeof(NavigationPage), StatusBarTextColorMode.MatchNavigationBarTextLuminosity);
public static StatusBarTextColorMode GetStatusBarTextColorMode(BindableObject element)
{
return (StatusBarTextColorMode)element.GetValue(StatusBarTextColorModeProperty);
}
public static void SetStatusBarTextColorMode(BindableObject element, StatusBarTextColorMode value)
{
element.SetValue(StatusBarTextColorModeProperty, value);
}
public static StatusBarTextColorMode GetStatusBarTextColorMode(this IPlatformElementConfiguration<iOS, FormsElement> config)
{
return GetStatusBarTextColorMode(config.Element);
}
public static IPlatformElementConfiguration<iOS, FormsElement> SetStatusBarTextColorMode(this IPlatformElementConfiguration<iOS, FormsElement> config, StatusBarTextColorMode value)
{
SetStatusBarTextColorMode(config.Element, value);
return config;
}
#endregion
#region PrefersLargeTitles
public static readonly BindableProperty PrefersLargeTitlesProperty = BindableProperty.Create(nameof(PrefersLargeTitles), typeof(bool), typeof(Page), false);
public static bool GetPrefersLargeTitles(BindableObject element)
{
return (bool)element.GetValue(PrefersLargeTitlesProperty);
}
public static void SetPrefersLargeTitles(BindableObject element, bool value)
{
element.SetValue(PrefersLargeTitlesProperty, value);
}
public static IPlatformElementConfiguration<iOS, FormsElement> SetPrefersLargeTitles(this IPlatformElementConfiguration<iOS, FormsElement> config, bool value)
{
SetPrefersLargeTitles(config.Element, value);
return config;
}
public static bool PrefersLargeTitles(this IPlatformElementConfiguration<iOS, FormsElement> config)
{
return GetPrefersLargeTitles(config.Element);
}
#endregion
#region HideNavigationBarSeparator
public static readonly BindableProperty HideNavigationBarSeparatorProperty = BindableProperty.Create(nameof(HideNavigationBarSeparator), typeof(bool), typeof(Page), false);
public static bool GetHideNavigationBarSeparator(BindableObject element)
{
return (bool)element.GetValue(HideNavigationBarSeparatorProperty);
}
public static void SetHideNavigationBarSeparator(BindableObject element, bool value)
{
element.SetValue(HideNavigationBarSeparatorProperty, value);
}
public static IPlatformElementConfiguration<iOS, FormsElement> SetHideNavigationBarSeparator(this IPlatformElementConfiguration<iOS, FormsElement> config, bool value)
{
SetHideNavigationBarSeparator(config.Element, value);
return config;
}
public static bool HideNavigationBarSeparator(this IPlatformElementConfiguration<iOS, FormsElement> config)
{
return GetHideNavigationBarSeparator(config.Element);
}
#endregion
}
}