├── .gitignore
├── AlternateRowColorSample.Android
├── AlternateRowColorSample.Android.csproj
├── Assets
│ └── AboutAssets.txt
├── MainActivity.cs
├── Properties
│ ├── AndroidManifest.xml
│ └── AssemblyInfo.cs
└── Resources
│ ├── AboutResources.txt
│ ├── layout
│ ├── Tabbar.axml
│ └── Toolbar.axml
│ ├── mipmap-anydpi-v26
│ ├── icon.xml
│ └── icon_round.xml
│ ├── mipmap-hdpi
│ ├── Icon.png
│ └── launcher_foreground.png
│ ├── mipmap-mdpi
│ ├── icon.png
│ └── launcher_foreground.png
│ ├── mipmap-xhdpi
│ ├── Icon.png
│ └── launcher_foreground.png
│ ├── mipmap-xxhdpi
│ ├── Icon.png
│ └── launcher_foreground.png
│ ├── mipmap-xxxhdpi
│ ├── Icon.png
│ └── launcher_foreground.png
│ └── values
│ ├── colors.xml
│ └── styles.xml
├── AlternateRowColorSample.iOS
├── AlternateRowColorSample.iOS.csproj
├── AppDelegate.cs
├── Assets.xcassets
│ └── AppIcon.appiconset
│ │ ├── Contents.json
│ │ ├── Icon1024.png
│ │ ├── Icon120.png
│ │ ├── Icon152.png
│ │ ├── Icon167.png
│ │ ├── Icon180.png
│ │ ├── Icon20.png
│ │ ├── Icon29.png
│ │ ├── Icon40.png
│ │ ├── Icon58.png
│ │ ├── Icon60.png
│ │ ├── Icon76.png
│ │ ├── Icon80.png
│ │ └── Icon87.png
├── Entitlements.plist
├── Info.plist
├── Main.cs
├── Properties
│ └── AssemblyInfo.cs
└── Resources
│ ├── Default-568h@2x.png
│ ├── Default-Portrait.png
│ ├── Default-Portrait@2x.png
│ ├── Default.png
│ ├── Default@2x.png
│ └── LaunchScreen.storyboard
├── AlternateRowColorSample.sln
├── AlternateRowColorSample
├── AlternateColorDataTemplateSelector.cs
├── AlternateRowColorSample.csproj
├── App.xaml
├── App.xaml.cs
├── MainPage.xaml
└── MainPage.xaml.cs
└── README.md
/.gitignore:
--------------------------------------------------------------------------------
1 | # Autosave files
2 | *~
3 |
4 | # build
5 | [Oo]bj/
6 | [Bb]in/
7 | packages/
8 | TestResults/
9 |
10 | # globs
11 | Makefile.in
12 | *.DS_Store
13 | *.sln.cache
14 | *.suo
15 | *.cache
16 | *.pidb
17 | *.userprefs
18 | *.usertasks
19 | config.log
20 | config.make
21 | config.status
22 | aclocal.m4
23 | install-sh
24 | autom4te.cache/
25 | *.user
26 | *.tar.gz
27 | tarballs/
28 | test-results/
29 | Thumbs.db
30 | .vs/
31 |
32 | # Mac bundle stuff
33 | *.dmg
34 | *.app
35 |
36 | # resharper
37 | *_Resharper.*
38 | *.Resharper
39 |
40 | # dotCover
41 | *.dotCover
42 |
--------------------------------------------------------------------------------
/AlternateRowColorSample.Android/AlternateRowColorSample.Android.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {F54EB2B5-9717-4544-9C69-4DA78F949860}
7 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
8 | {c9e5eea5-ca05-42a1-839b-61506e0a37df}
9 | Library
10 | AlternateRowColorSample.Droid
11 | AlternateRowColorSample.Android
12 | True
13 | Resources\Resource.designer.cs
14 | Resource
15 | Properties\AndroidManifest.xml
16 | Resources
17 | Assets
18 | false
19 | v8.1
20 | Xamarin.Android.Net.AndroidClientHandler
21 |
22 |
23 |
24 |
25 | true
26 | portable
27 | false
28 | bin\Debug
29 | DEBUG;
30 | prompt
31 | 4
32 | None
33 |
34 |
35 | true
36 | pdbonly
37 | true
38 | bin\Release
39 | prompt
40 | 4
41 | true
42 | false
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 | {510FB103-B083-4957-9C56-039D966DF170}
97 | AlternateRowColorSample
98 |
99 |
100 |
101 |
102 |
--------------------------------------------------------------------------------
/AlternateRowColorSample.Android/Assets/AboutAssets.txt:
--------------------------------------------------------------------------------
1 | Any raw assets you want to be deployed with your application can be placed in
2 | this directory (and child directories) and given a Build Action of "AndroidAsset".
3 |
4 | These files will be deployed with you package and will be accessible using Android's
5 | AssetManager, like this:
6 |
7 | public class ReadAsset : Activity
8 | {
9 | protected override void OnCreate (Bundle bundle)
10 | {
11 | base.OnCreate (bundle);
12 |
13 | InputStream input = Assets.Open ("my_asset.txt");
14 | }
15 | }
16 |
17 | Additionally, some Android functions will automatically load asset files:
18 |
19 | Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
20 |
--------------------------------------------------------------------------------
/AlternateRowColorSample.Android/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Android.App;
4 | using Android.Content.PM;
5 | using Android.Runtime;
6 | using Android.Views;
7 | using Android.Widget;
8 | using Android.OS;
9 |
10 | namespace AlternateRowColorSample.Droid
11 | {
12 | [Activity(Label = "AlternateRowColorSample", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
13 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
14 | {
15 | protected override void OnCreate(Bundle savedInstanceState)
16 | {
17 | TabLayoutResource = Resource.Layout.Tabbar;
18 | ToolbarResource = Resource.Layout.Toolbar;
19 |
20 | base.OnCreate(savedInstanceState);
21 | global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
22 | LoadApplication(new App());
23 | }
24 | }
25 | }
--------------------------------------------------------------------------------
/AlternateRowColorSample.Android/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
--------------------------------------------------------------------------------
/AlternateRowColorSample.Android/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 | using Android.App;
5 |
6 | // General Information about an assembly is controlled through the following
7 | // set of attributes. Change these attribute values to modify the information
8 | // associated with an assembly.
9 | [assembly: AssemblyTitle("AlternateRowColorSample.Android")]
10 | [assembly: AssemblyDescription("")]
11 | [assembly: AssemblyConfiguration("")]
12 | [assembly: AssemblyCompany("")]
13 | [assembly: AssemblyProduct("AlternateRowColorSample.Android")]
14 | [assembly: AssemblyCopyright("Copyright © 2014")]
15 | [assembly: AssemblyTrademark("")]
16 | [assembly: AssemblyCulture("")]
17 | [assembly: ComVisible(false)]
18 |
19 | // Version information for an assembly consists of the following four values:
20 | //
21 | // Major Version
22 | // Minor Version
23 | // Build Number
24 | // Revision
25 | //
26 | // You can specify all the values or you can default the Build and Revision Numbers
27 | // by using the '*' as shown below:
28 | // [assembly: AssemblyVersion("1.0.*")]
29 | [assembly: AssemblyVersion("1.0.0.0")]
30 | [assembly: AssemblyFileVersion("1.0.0.0")]
31 |
32 | // Add some common permissions, these can be removed if not needed
33 | [assembly: UsesPermission(Android.Manifest.Permission.Internet)]
34 | [assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
35 |
--------------------------------------------------------------------------------
/AlternateRowColorSample.Android/Resources/AboutResources.txt:
--------------------------------------------------------------------------------
1 | Images, layout descriptions, binary blobs and string dictionaries can be included
2 | in your application as resource files. Various Android APIs are designed to
3 | operate on the resource IDs instead of dealing with images, strings or binary blobs
4 | directly.
5 |
6 | For example, a sample Android app that contains a user interface layout (main.xml),
7 | an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8 | would keep its resources in the "Resources" directory of the application:
9 |
10 | Resources/
11 | drawable-hdpi/
12 | icon.png
13 |
14 | drawable-ldpi/
15 | icon.png
16 |
17 | drawable-mdpi/
18 | icon.png
19 |
20 | layout/
21 | main.xml
22 |
23 | values/
24 | strings.xml
25 |
26 | In order to get the build system to recognize Android resources, set the build action to
27 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
28 | instead operate on resource IDs. When you compile an Android application that uses resources,
29 | the build system will package the resources for distribution and generate a class called
30 | "Resource" that contains the tokens for each one of the resources included. For example,
31 | for the above Resources layout, this is what the Resource class would expose:
32 |
33 | public class Resource {
34 | public class drawable {
35 | public const int icon = 0x123;
36 | }
37 |
38 | public class layout {
39 | public const int main = 0x456;
40 | }
41 |
42 | public class strings {
43 | public const int first_string = 0xabc;
44 | public const int second_string = 0xbcd;
45 | }
46 | }
47 |
48 | You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
49 | to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
50 | string in the dictionary file values/strings.xml.
51 |
--------------------------------------------------------------------------------
/AlternateRowColorSample.Android/Resources/layout/Tabbar.axml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/AlternateRowColorSample.Android/Resources/layout/Toolbar.axml:
--------------------------------------------------------------------------------
1 |
2 |
--------------------------------------------------------------------------------
/AlternateRowColorSample.Android/Resources/mipmap-anydpi-v26/icon.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/AlternateRowColorSample.Android/Resources/mipmap-anydpi-v26/icon_round.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/AlternateRowColorSample.Android/Resources/mipmap-hdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.Android/Resources/mipmap-hdpi/Icon.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.Android/Resources/mipmap-hdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.Android/Resources/mipmap-hdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.Android/Resources/mipmap-mdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.Android/Resources/mipmap-mdpi/icon.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.Android/Resources/mipmap-mdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.Android/Resources/mipmap-mdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.Android/Resources/mipmap-xhdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.Android/Resources/mipmap-xhdpi/Icon.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.Android/Resources/mipmap-xhdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.Android/Resources/mipmap-xhdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.Android/Resources/mipmap-xxhdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.Android/Resources/mipmap-xxhdpi/Icon.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.Android/Resources/mipmap-xxhdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.Android/Resources/mipmap-xxhdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.Android/Resources/mipmap-xxxhdpi/Icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.Android/Resources/mipmap-xxxhdpi/Icon.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.Android/Resources/mipmap-xxxhdpi/launcher_foreground.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.Android/Resources/values/colors.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 | #FFFFFF
4 | #3F51B5
5 | #303F9F
6 | #FF4081
7 |
--------------------------------------------------------------------------------
/AlternateRowColorSample.Android/Resources/values/styles.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
5 |
6 |
24 |
27 |
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/AlternateRowColorSample.iOS.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | iPhoneSimulator
6 | 8.0.30703
7 | 2.0
8 | {3D89D862-190C-42A6-BC80-3AD41494B2E3}
9 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
10 | {6143fdea-f3c2-4a09-aafa-6e230626515e}
11 | Exe
12 | AlternateRowColorSample.iOS
13 | Resources
14 | AlternateRowColorSample.iOS
15 | NSUrlSessionHandler
16 |
17 |
18 |
19 |
20 | true
21 | full
22 | false
23 | bin\iPhoneSimulator\Debug
24 | DEBUG
25 | prompt
26 | 4
27 | false
28 | x86_64
29 | None
30 | true
31 |
32 |
33 | none
34 | true
35 | bin\iPhoneSimulator\Release
36 | prompt
37 | 4
38 | None
39 | x86_64
40 | false
41 |
42 |
43 | true
44 | full
45 | false
46 | bin\iPhone\Debug
47 | DEBUG
48 | prompt
49 | 4
50 | false
51 | ARM64
52 | iPhone Developer
53 | true
54 | Entitlements.plist
55 |
56 |
57 | none
58 | true
59 | bin\iPhone\Release
60 | prompt
61 | 4
62 | ARM64
63 | false
64 | iPhone Developer
65 | Entitlements.plist
66 |
67 |
68 | none
69 | True
70 | bin\iPhone\Ad-Hoc
71 | prompt
72 | 4
73 | False
74 | ARM64
75 | True
76 | Automatic:AdHoc
77 | iPhone Distribution
78 | Entitlements.plist
79 |
80 |
81 | none
82 | True
83 | bin\iPhone\AppStore
84 | prompt
85 | 4
86 | False
87 | ARM64
88 | Automatic:AppStore
89 | iPhone Distribution
90 | Entitlements.plist
91 |
92 |
93 |
94 |
95 |
96 |
97 |
98 |
99 |
100 |
101 |
102 | false
103 |
104 |
105 | false
106 |
107 |
108 | false
109 |
110 |
111 | false
112 |
113 |
114 | false
115 |
116 |
117 | false
118 |
119 |
120 | false
121 |
122 |
123 | false
124 |
125 |
126 | false
127 |
128 |
129 | false
130 |
131 |
132 | false
133 |
134 |
135 | false
136 |
137 |
138 | false
139 |
140 |
141 | false
142 |
143 |
144 |
145 |
146 |
147 |
148 |
149 |
150 |
151 |
152 |
153 |
154 |
155 |
156 | {510FB103-B083-4957-9C56-039D966DF170}
157 | AlternateRowColorSample
158 |
159 |
160 |
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/AppDelegate.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | using Foundation;
6 | using UIKit;
7 |
8 | namespace AlternateRowColorSample.iOS
9 | {
10 | // The UIApplicationDelegate for the application. This class is responsible for launching the
11 | // User Interface of the application, as well as listening (and optionally responding) to
12 | // application events from iOS.
13 | [Register("AppDelegate")]
14 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
15 | {
16 | //
17 | // This method is invoked when the application has loaded and is ready to run. In this
18 | // method you should instantiate the window, load the UI into it and then make the window
19 | // visible.
20 | //
21 | // You have 17 seconds to return from this method, or iOS will terminate your application.
22 | //
23 | public override bool FinishedLaunching(UIApplication app, NSDictionary options)
24 | {
25 | global::Xamarin.Forms.Forms.Init();
26 | LoadApplication(new App());
27 |
28 | return base.FinishedLaunching(app, options);
29 | }
30 | }
31 | }
32 |
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "scale": "2x",
5 | "size": "20x20",
6 | "idiom": "iphone",
7 | "filename": "Icon40.png"
8 | },
9 | {
10 | "scale": "3x",
11 | "size": "20x20",
12 | "idiom": "iphone",
13 | "filename": "Icon60.png"
14 | },
15 | {
16 | "scale": "2x",
17 | "size": "29x29",
18 | "idiom": "iphone",
19 | "filename": "Icon58.png"
20 | },
21 | {
22 | "scale": "3x",
23 | "size": "29x29",
24 | "idiom": "iphone",
25 | "filename": "Icon87.png"
26 | },
27 | {
28 | "scale": "2x",
29 | "size": "40x40",
30 | "idiom": "iphone",
31 | "filename": "Icon80.png"
32 | },
33 | {
34 | "scale": "3x",
35 | "size": "40x40",
36 | "idiom": "iphone",
37 | "filename": "Icon120.png"
38 | },
39 | {
40 | "scale": "2x",
41 | "size": "60x60",
42 | "idiom": "iphone",
43 | "filename": "Icon120.png"
44 | },
45 | {
46 | "scale": "3x",
47 | "size": "60x60",
48 | "idiom": "iphone",
49 | "filename": "Icon180.png"
50 | },
51 | {
52 | "scale": "1x",
53 | "size": "20x20",
54 | "idiom": "ipad",
55 | "filename": "Icon20.png"
56 | },
57 | {
58 | "scale": "2x",
59 | "size": "20x20",
60 | "idiom": "ipad",
61 | "filename": "Icon40.png"
62 | },
63 | {
64 | "scale": "1x",
65 | "size": "29x29",
66 | "idiom": "ipad",
67 | "filename": "Icon29.png"
68 | },
69 | {
70 | "scale": "2x",
71 | "size": "29x29",
72 | "idiom": "ipad",
73 | "filename": "Icon58.png"
74 | },
75 | {
76 | "scale": "1x",
77 | "size": "40x40",
78 | "idiom": "ipad",
79 | "filename": "Icon40.png"
80 | },
81 | {
82 | "scale": "2x",
83 | "size": "40x40",
84 | "idiom": "ipad",
85 | "filename": "Icon80.png"
86 | },
87 | {
88 | "scale": "1x",
89 | "size": "76x76",
90 | "idiom": "ipad",
91 | "filename": "Icon76.png"
92 | },
93 | {
94 | "scale": "2x",
95 | "size": "76x76",
96 | "idiom": "ipad",
97 | "filename": "Icon152.png"
98 | },
99 | {
100 | "scale": "2x",
101 | "size": "83.5x83.5",
102 | "idiom": "ipad",
103 | "filename": "Icon167.png"
104 | },
105 | {
106 | "scale": "1x",
107 | "size": "1024x1024",
108 | "idiom": "ios-marketing",
109 | "filename": "Icon1024.png"
110 | }
111 | ],
112 | "properties": {},
113 | "info": {
114 | "version": 1,
115 | "author": "xcode"
116 | }
117 | }
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon1024.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon120.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon152.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon167.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon180.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon20.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon29.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon40.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon58.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon60.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon76.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon80.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.iOS/Assets.xcassets/AppIcon.appiconset/Icon87.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | UIDeviceFamily
6 |
7 | 1
8 | 2
9 |
10 | UISupportedInterfaceOrientations
11 |
12 | UIInterfaceOrientationPortrait
13 | UIInterfaceOrientationLandscapeLeft
14 | UIInterfaceOrientationLandscapeRight
15 |
16 | UISupportedInterfaceOrientations~ipad
17 |
18 | UIInterfaceOrientationPortrait
19 | UIInterfaceOrientationPortraitUpsideDown
20 | UIInterfaceOrientationLandscapeLeft
21 | UIInterfaceOrientationLandscapeRight
22 |
23 | MinimumOSVersion
24 | 8.0
25 | CFBundleDisplayName
26 | AlternateRowColorSample
27 | CFBundleIdentifier
28 | nl.versluis.AlternateRowColorSample
29 | CFBundleVersion
30 | 1.0
31 | UILaunchStoryboardName
32 | LaunchScreen
33 | CFBundleName
34 | AlternateRowColorSample
35 | XSAppIconAssets
36 | Assets.xcassets/AppIcon.appiconset
37 |
38 |
39 |
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Main.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 |
5 | using Foundation;
6 | using UIKit;
7 |
8 | namespace AlternateRowColorSample.iOS
9 | {
10 | public class Application
11 | {
12 | // This is the main entry point of the application.
13 | static void Main(string[] args)
14 | {
15 | // if you want to use a different Application Delegate class from "AppDelegate"
16 | // you can specify it here.
17 | UIApplication.Main(args, null, "AppDelegate");
18 | }
19 | }
20 | }
21 |
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using System.Runtime.InteropServices;
4 |
5 | // General Information about an assembly is controlled through the following
6 | // set of attributes. Change these attribute values to modify the information
7 | // associated with an assembly.
8 | [assembly: AssemblyTitle("AlternateRowColorSample.iOS")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("AlternateRowColorSample.iOS")]
13 | [assembly: AssemblyCopyright("Copyright © 2014")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // Setting ComVisible to false makes the types in this assembly not visible
18 | // to COM components. If you need to access a type in this assembly from
19 | // COM, set the ComVisible attribute to true on that type.
20 | [assembly: ComVisible(false)]
21 |
22 | // The following GUID is for the ID of the typelib if this project is exposed to COM
23 | [assembly: Guid("72bdc44f-c588-44f3-b6df-9aace7daafdd")]
24 |
25 | // Version information for an assembly consists of the following four values:
26 | //
27 | // Major Version
28 | // Minor Version
29 | // Build Number
30 | // Revision
31 | //
32 | // You can specify all the values or you can default the Build and Revision Numbers
33 | // by using the '*' as shown below:
34 | // [assembly: AssemblyVersion("1.0.*")]
35 | [assembly: AssemblyVersion("1.0.0.0")]
36 | [assembly: AssemblyFileVersion("1.0.0.0")]
37 |
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Resources/Default-568h@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.iOS/Resources/Default-568h@2x.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Resources/Default-Portrait.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.iOS/Resources/Default-Portrait.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Resources/Default-Portrait@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.iOS/Resources/Default-Portrait@2x.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Resources/Default.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.iOS/Resources/Default.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Resources/Default@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/jfversluis/AlternateRowColorSample/f60aab9b2c5c3f0fe10308d90f0c476ef7688449/AlternateRowColorSample.iOS/Resources/Default@2x.png
--------------------------------------------------------------------------------
/AlternateRowColorSample.iOS/Resources/LaunchScreen.storyboard:
--------------------------------------------------------------------------------
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 |
--------------------------------------------------------------------------------
/AlternateRowColorSample.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 15
4 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AlternateRowColorSample.Android", "AlternateRowColorSample.Android\AlternateRowColorSample.Android.csproj", "{F54EB2B5-9717-4544-9C69-4DA78F949860}"
5 | EndProject
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AlternateRowColorSample.iOS", "AlternateRowColorSample.iOS\AlternateRowColorSample.iOS.csproj", "{3D89D862-190C-42A6-BC80-3AD41494B2E3}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AlternateRowColorSample", "AlternateRowColorSample\AlternateRowColorSample.csproj", "{510FB103-B083-4957-9C56-039D966DF170}"
9 | EndProject
10 | Global
11 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
12 | Debug|Any CPU = Debug|Any CPU
13 | Release|Any CPU = Release|Any CPU
14 | Debug|iPhoneSimulator = Debug|iPhoneSimulator
15 | Release|iPhoneSimulator = Release|iPhoneSimulator
16 | Debug|iPhone = Debug|iPhone
17 | Release|iPhone = Release|iPhone
18 | Ad-Hoc|iPhone = Ad-Hoc|iPhone
19 | AppStore|iPhone = AppStore|iPhone
20 | EndGlobalSection
21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
22 | {F54EB2B5-9717-4544-9C69-4DA78F949860}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23 | {F54EB2B5-9717-4544-9C69-4DA78F949860}.Debug|Any CPU.Build.0 = Debug|Any CPU
24 | {F54EB2B5-9717-4544-9C69-4DA78F949860}.Release|Any CPU.ActiveCfg = Release|Any CPU
25 | {F54EB2B5-9717-4544-9C69-4DA78F949860}.Release|Any CPU.Build.0 = Release|Any CPU
26 | {F54EB2B5-9717-4544-9C69-4DA78F949860}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
27 | {F54EB2B5-9717-4544-9C69-4DA78F949860}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
28 | {F54EB2B5-9717-4544-9C69-4DA78F949860}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
29 | {F54EB2B5-9717-4544-9C69-4DA78F949860}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
30 | {F54EB2B5-9717-4544-9C69-4DA78F949860}.Debug|iPhone.ActiveCfg = Debug|Any CPU
31 | {F54EB2B5-9717-4544-9C69-4DA78F949860}.Debug|iPhone.Build.0 = Debug|Any CPU
32 | {F54EB2B5-9717-4544-9C69-4DA78F949860}.Release|iPhone.ActiveCfg = Release|Any CPU
33 | {F54EB2B5-9717-4544-9C69-4DA78F949860}.Release|iPhone.Build.0 = Release|Any CPU
34 | {F54EB2B5-9717-4544-9C69-4DA78F949860}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
35 | {F54EB2B5-9717-4544-9C69-4DA78F949860}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
36 | {F54EB2B5-9717-4544-9C69-4DA78F949860}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
37 | {F54EB2B5-9717-4544-9C69-4DA78F949860}.AppStore|iPhone.Build.0 = Debug|Any CPU
38 | {3D89D862-190C-42A6-BC80-3AD41494B2E3}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
39 | {3D89D862-190C-42A6-BC80-3AD41494B2E3}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
40 | {3D89D862-190C-42A6-BC80-3AD41494B2E3}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator
41 | {3D89D862-190C-42A6-BC80-3AD41494B2E3}.Release|Any CPU.Build.0 = Release|iPhoneSimulator
42 | {3D89D862-190C-42A6-BC80-3AD41494B2E3}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
43 | {3D89D862-190C-42A6-BC80-3AD41494B2E3}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
44 | {3D89D862-190C-42A6-BC80-3AD41494B2E3}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
45 | {3D89D862-190C-42A6-BC80-3AD41494B2E3}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
46 | {3D89D862-190C-42A6-BC80-3AD41494B2E3}.Debug|iPhone.ActiveCfg = Debug|iPhone
47 | {3D89D862-190C-42A6-BC80-3AD41494B2E3}.Debug|iPhone.Build.0 = Debug|iPhone
48 | {3D89D862-190C-42A6-BC80-3AD41494B2E3}.Release|iPhone.ActiveCfg = Release|iPhone
49 | {3D89D862-190C-42A6-BC80-3AD41494B2E3}.Release|iPhone.Build.0 = Release|iPhone
50 | {3D89D862-190C-42A6-BC80-3AD41494B2E3}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone
51 | {3D89D862-190C-42A6-BC80-3AD41494B2E3}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone
52 | {3D89D862-190C-42A6-BC80-3AD41494B2E3}.AppStore|iPhone.ActiveCfg = AppStore|iPhone
53 | {3D89D862-190C-42A6-BC80-3AD41494B2E3}.AppStore|iPhone.Build.0 = AppStore|iPhone
54 | {510FB103-B083-4957-9C56-039D966DF170}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
55 | {510FB103-B083-4957-9C56-039D966DF170}.Debug|Any CPU.Build.0 = Debug|Any CPU
56 | {510FB103-B083-4957-9C56-039D966DF170}.Release|Any CPU.ActiveCfg = Release|Any CPU
57 | {510FB103-B083-4957-9C56-039D966DF170}.Release|Any CPU.Build.0 = Release|Any CPU
58 | {510FB103-B083-4957-9C56-039D966DF170}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
59 | {510FB103-B083-4957-9C56-039D966DF170}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
60 | {510FB103-B083-4957-9C56-039D966DF170}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
61 | {510FB103-B083-4957-9C56-039D966DF170}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
62 | {510FB103-B083-4957-9C56-039D966DF170}.Debug|iPhone.ActiveCfg = Debug|Any CPU
63 | {510FB103-B083-4957-9C56-039D966DF170}.Debug|iPhone.Build.0 = Debug|Any CPU
64 | {510FB103-B083-4957-9C56-039D966DF170}.Release|iPhone.ActiveCfg = Release|Any CPU
65 | {510FB103-B083-4957-9C56-039D966DF170}.Release|iPhone.Build.0 = Release|Any CPU
66 | {510FB103-B083-4957-9C56-039D966DF170}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
67 | {510FB103-B083-4957-9C56-039D966DF170}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
68 | {510FB103-B083-4957-9C56-039D966DF170}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
69 | {510FB103-B083-4957-9C56-039D966DF170}.AppStore|iPhone.Build.0 = Debug|Any CPU
70 | EndGlobalSection
71 | EndGlobal
72 |
--------------------------------------------------------------------------------
/AlternateRowColorSample/AlternateColorDataTemplateSelector.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using Xamarin.Forms;
4 |
5 | namespace AlternateRowColorSample
6 | {
7 | public class AlternateColorDataTemplateSelector : DataTemplateSelector
8 | {
9 | public DataTemplate EvenTemplate { get; set; }
10 | public DataTemplate UnevenTemplate { get; set; }
11 |
12 | protected override DataTemplate OnSelectTemplate(object item, BindableObject container)
13 | {
14 | // TODO: Maybe some more error handling here
15 | return ((List)((ListView)container).ItemsSource).IndexOf(item as string) % 2 == 0 ? EvenTemplate : UnevenTemplate;
16 | }
17 | }
18 | }
--------------------------------------------------------------------------------
/AlternateRowColorSample/AlternateRowColorSample.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | netstandard2.0
5 |
6 |
7 |
8 | pdbonly
9 | true
10 |
11 |
12 |
13 |
14 |
15 |
--------------------------------------------------------------------------------
/AlternateRowColorSample/App.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/AlternateRowColorSample/App.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using Xamarin.Forms;
3 | using Xamarin.Forms.Xaml;
4 |
5 | [assembly: XamlCompilation(XamlCompilationOptions.Compile)]
6 | namespace AlternateRowColorSample
7 | {
8 | public partial class App : Application
9 | {
10 | public App()
11 | {
12 | InitializeComponent();
13 |
14 | MainPage = new MainPage();
15 | }
16 |
17 | protected override void OnStart()
18 | {
19 | // Handle when your app starts
20 | }
21 |
22 | protected override void OnSleep()
23 | {
24 | // Handle when your app sleeps
25 | }
26 |
27 | protected override void OnResume()
28 | {
29 | // Handle when your app resumes
30 | }
31 | }
32 | }
33 |
--------------------------------------------------------------------------------
/AlternateRowColorSample/MainPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
15 |
16 |
17 |
18 |
19 |
22 |
23 |
24 |
25 |
26 |
27 |
28 |
--------------------------------------------------------------------------------
/AlternateRowColorSample/MainPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System.Collections.Generic;
2 | using Xamarin.Forms;
3 |
4 | namespace AlternateRowColorSample
5 | {
6 | public partial class MainPage : ContentPage
7 | {
8 | public List Items { get; set; } = new List()
9 | {
10 | "R2-D2",
11 | "3CPO",
12 | "Luke Skywalker",
13 | "Darth Vader",
14 | "Han Solo",
15 | "Chewbacca",
16 | "Yoda",
17 | "Obi-Wan Kenobi"
18 | };
19 |
20 | public MainPage()
21 | {
22 | InitializeComponent();
23 |
24 | BindingContext = this;
25 | }
26 | }
27 | }
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | # AlternateRowColorSample
2 | Answer to a Stackoverflow question about how to implement an alternate row color in a Xamarin.Forms ListView. Implemented with a `DataTemplateSelector`.
3 |
4 | 
5 |
6 | Question and answer can be found here: https://stackoverflow.com/questions/51422465/alternating-item-backgroundcolor-in-xamarin-forms-listview
7 |
--------------------------------------------------------------------------------