blob: dfbc342c71e138ce30e49fbb79507fee2d3fc816 (
plain)
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
|
using System.Diagnostics;
namespace Xamarin.Forms.Controls
{
public class NavigationBarGallery : ContentPage
{
public NavigationBarGallery (NavigationPage rootNavPage)
{
int toggleBarTextColor = 0;
int toggleBarBackgroundColor = 0;
Content = new StackLayout {
Children = {
new Button {
Text = "Change BarTextColor",
Command = new Command (() => {
if (toggleBarTextColor % 2 == 0) {
rootNavPage.BarTextColor = Color.Teal;
} else {
rootNavPage.BarTextColor = Color.Default;
}
toggleBarTextColor++;
})
},
new Button {
Text = "Change BarBackgroundColor",
Command = new Command (() => {
if (toggleBarBackgroundColor % 2 == 0) {
rootNavPage.BarBackgroundColor = Color.Navy;
} else {
rootNavPage.BarBackgroundColor = Color.Default;
}
toggleBarBackgroundColor++;
})
},
new Button {
Text = "Change Both to default",
Command = new Command (() => {
rootNavPage.BarTextColor = Color.Default;
rootNavPage.BarBackgroundColor = Color.Default;
})
},
new Button {
Text = "Make sure Tint still works",
Command = new Command (() => {
rootNavPage.Tint = Color.Red;
})
},
new Button {
Text = "Black background, white text",
Command = new Command (() => {
rootNavPage.BarTextColor = Color.White;
rootNavPage.BarBackgroundColor = Color.Black;
})
}
}
};
}
}
}
|