-
Notifications
You must be signed in to change notification settings - Fork 53
/
Copy pathStyles.cs
57 lines (47 loc) · 1.81 KB
/
Styles.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
using System;
using Xamarin.Forms;
using ReactiveExtensionExamples.Extensions;
namespace ReactiveExtensionExamples.Values
{
public static class Styles
{
public const string
ReactiveNavigation = "ReactiveNavigation",
ReactiveButton = "ReactiveButton",
ReactiveEntry = "ReactiveEntry",
ReactiveActivityIndicator = "ReactiveActivityIndicator";
static Color
Indigo = Color.FromHex("#4C108C"),
MediumVioletRed = Color.FromHex("#B7178C");
public static void Initialize (){
if(Application.Current.Resources == null)
Application.Current.Resources = new ResourceDictionary ();
Application.Current.Resources.Add(CreateReactiveNavigationStyle ());
Application.Current.Resources.Add( CreateReactiveButtonStyle ());
Application.Current.Resources.Add(CreateReactiveEntryStyle ());
Application.Current.Resources.Add(CreateReactiveActivityIndicatorStyle ());
}
static Style CreateReactiveNavigationStyle (){
return new Style (typeof(NavigationPage))
.Set (NavigationPage.BarBackgroundColorProperty, Indigo)
.Set (NavigationPage.BarTextColorProperty, Color.White)
.Set (NavigationPage.IconImageSourceProperty, "slideout.png")
.Set(NavigationPage.IconColorProperty, Color.White);
}
static Style CreateReactiveButtonStyle (){
return new Style (typeof(Button))
.Set (Button.BackgroundColorProperty, MediumVioletRed)
.Set (Button.TextColorProperty, Color.White)
.Set (Button.MarginProperty, new Thickness(8d));
}
static Style CreateReactiveEntryStyle (){
return new Style (typeof(Entry))
.Set (Entry.TextColorProperty, MediumVioletRed)
.Set (Entry.MarginProperty, new Thickness(8d));
}
static Style CreateReactiveActivityIndicatorStyle (){
return new Style (typeof(ActivityIndicator))
.Set (ActivityIndicator.ColorProperty, MediumVioletRed);
}
}
}