├── iOS
├── Resources
│ ├── checked.png
│ ├── checked@2x.png
│ ├── checked@3x.png
│ ├── pkballs.sketch
│ ├── unchecked.png
│ ├── unchecked@2x.png
│ ├── unchecked@3x.png
│ ├── Images.xcassets
│ │ └── AppIcons.appiconset
│ │ │ └── Contents.json
│ └── LaunchScreen.xib
├── packages.config
├── Entitlements.plist
├── Main.cs
├── AppDelegate.cs
├── Info.plist
├── Controls
│ ├── CheckBoxRenderer.cs
│ └── CheckBoxView Che.cs
└── MultiPokeListView.iOS.csproj
├── Droid
├── Resources
│ ├── drawable
│ │ └── icon.png
│ ├── drawable-hdpi
│ │ └── icon.png
│ ├── drawable-xhdpi
│ │ └── icon.png
│ ├── drawable-xxhdpi
│ │ └── icon.png
│ ├── Resource.designer.cs
│ └── AboutResources.txt
├── packages.config
├── Properties
│ ├── AndroidManifest.xml
│ └── AssemblyInfo.cs
├── Assets
│ └── AboutAssets.txt
├── MainActivity.cs
└── MultiPokeListView.Droid.csproj
├── MultiPokeListView
├── packages.config
├── SelectableItemWrapper.cs
├── Pokemon.cs
├── Pages
│ ├── PokemonListXamlPage.xaml.cs
│ ├── SelectedPokemonPage.cs
│ ├── PokemonListXamlPage.xaml
│ └── PokemonListPage.cs
├── App.cs
├── Properties
│ └── AssemblyInfo.cs
├── Controls
│ ├── CheckBox.cs
│ └── PokemonSelectableCell.cs
├── MultiPokeListView.csproj
└── ViewModels
│ └── PokemonsViewModel.cs
├── .gitignore
├── MultiPokeList.sln
└── LICENSE
/iOS/Resources/checked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thatcsharpguy/MultiPokeList/master/iOS/Resources/checked.png
--------------------------------------------------------------------------------
/iOS/Resources/checked@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thatcsharpguy/MultiPokeList/master/iOS/Resources/checked@2x.png
--------------------------------------------------------------------------------
/iOS/Resources/checked@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thatcsharpguy/MultiPokeList/master/iOS/Resources/checked@3x.png
--------------------------------------------------------------------------------
/iOS/Resources/pkballs.sketch:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thatcsharpguy/MultiPokeList/master/iOS/Resources/pkballs.sketch
--------------------------------------------------------------------------------
/iOS/Resources/unchecked.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thatcsharpguy/MultiPokeList/master/iOS/Resources/unchecked.png
--------------------------------------------------------------------------------
/iOS/Resources/unchecked@2x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thatcsharpguy/MultiPokeList/master/iOS/Resources/unchecked@2x.png
--------------------------------------------------------------------------------
/iOS/Resources/unchecked@3x.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thatcsharpguy/MultiPokeList/master/iOS/Resources/unchecked@3x.png
--------------------------------------------------------------------------------
/Droid/Resources/drawable/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thatcsharpguy/MultiPokeList/master/Droid/Resources/drawable/icon.png
--------------------------------------------------------------------------------
/Droid/Resources/drawable-hdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thatcsharpguy/MultiPokeList/master/Droid/Resources/drawable-hdpi/icon.png
--------------------------------------------------------------------------------
/Droid/Resources/drawable-xhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thatcsharpguy/MultiPokeList/master/Droid/Resources/drawable-xhdpi/icon.png
--------------------------------------------------------------------------------
/Droid/Resources/drawable-xxhdpi/icon.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/thatcsharpguy/MultiPokeList/master/Droid/Resources/drawable-xxhdpi/icon.png
--------------------------------------------------------------------------------
/iOS/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/MultiPokeListView/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
--------------------------------------------------------------------------------
/iOS/Entitlements.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
--------------------------------------------------------------------------------
/MultiPokeListView/SelectableItemWrapper.cs:
--------------------------------------------------------------------------------
1 | namespace MultiPokeListView
2 | {
3 | public class SelectableItemWrapper
4 | {
5 | public bool IsSelected { get; set; }
6 | public T Item { get; set; }
7 | }
8 | }
9 |
10 |
11 |
--------------------------------------------------------------------------------
/Droid/packages.config:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
--------------------------------------------------------------------------------
/MultiPokeListView/Pokemon.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | namespace MultiPokeListView
4 | {
5 | public class Pokemon
6 | {
7 | public int Id { get; set; }
8 | public string Name { get; set; }
9 | public double Weight { get; set; }
10 | public double Height { get; set; }
11 | }
12 | }
13 |
14 |
15 |
--------------------------------------------------------------------------------
/Droid/Properties/AndroidManifest.xml:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
--------------------------------------------------------------------------------
/MultiPokeListView/Pages/PokemonListXamlPage.xaml.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Collections.Generic;
3 | using System.Linq;
4 | using System.Text;
5 | using System.Threading.Tasks;
6 |
7 | using Xamarin.Forms;
8 |
9 | namespace MultiPokeListView.Pages
10 | {
11 | public partial class PokemonListXamlPage : ContentPage
12 | {
13 | public PokemonListXamlPage()
14 | {
15 | BindingContext = (App.Current as App).PokemonsViewModel;
16 | InitializeComponent();
17 | }
18 | }
19 | }
20 |
--------------------------------------------------------------------------------
/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 MultiPokeListView.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 |
22 |
--------------------------------------------------------------------------------
/.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 |
31 | #Mac bundle stuff
32 | *.dmg
33 | *.app
34 |
35 | #resharper
36 | *_Resharper.*
37 | *.Resharper
38 |
39 | #dotCover
40 | *.dotCover
41 |
--------------------------------------------------------------------------------
/Droid/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 your 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 |
--------------------------------------------------------------------------------
/MultiPokeListView/Pages/SelectedPokemonPage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Xamarin.Forms;
4 |
5 | namespace MultiPokeListView.Pages
6 | {
7 | public class SelectedPokemonPage : ContentPage
8 | {
9 | public SelectedPokemonPage()
10 | {
11 | BindingContext = (App.Current as App).PokemonsViewModel;
12 | Title = "Elegidos";
13 |
14 | var selectedListView = new ListView();
15 | selectedListView.SetBinding(ListView.ItemsSourceProperty, "SelectedPokemons");
16 |
17 | var textCell = new DataTemplate(typeof(TextCell));
18 | textCell.SetBinding(TextCell.TextProperty, "Name");
19 | selectedListView.ItemTemplate = textCell;
20 |
21 | Content = selectedListView;
22 | }
23 | }
24 | }
25 |
26 |
27 |
--------------------------------------------------------------------------------
/Droid/MainActivity.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Android.App;
4 | using Android.Content;
5 | using Android.Content.PM;
6 | using Android.Runtime;
7 | using Android.Views;
8 | using Android.Widget;
9 | using Android.OS;
10 |
11 | namespace MultiPokeListView.Droid
12 | {
13 | [Activity(Label = "MultiPokeListView.Droid", Icon = "@drawable/icon", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
14 | public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsApplicationActivity
15 | {
16 | protected override void OnCreate(Bundle bundle)
17 | {
18 | base.OnCreate(bundle);
19 |
20 | global::Xamarin.Forms.Forms.Init(this, bundle);
21 |
22 | LoadApplication(new App());
23 | }
24 | }
25 | }
26 |
27 |
--------------------------------------------------------------------------------
/MultiPokeListView/Pages/PokemonListXamlPage.xaml:
--------------------------------------------------------------------------------
1 |
2 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
18 |
19 |
20 |
21 |
22 |
--------------------------------------------------------------------------------
/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 MultiPokeListView.iOS
9 | {
10 | [Register("AppDelegate")]
11 | public partial class AppDelegate : global::Xamarin.Forms.Platform.iOS.FormsApplicationDelegate
12 | {
13 | public override bool FinishedLaunching(UIApplication app, NSDictionary options)
14 | {
15 | global::Xamarin.Forms.Forms.Init();
16 |
17 | UINavigationBar.Appearance.BarTintColor = UIColor.Red;
18 | UINavigationBar.Appearance.TintColor = UIColor.White;
19 | UINavigationBar.Appearance.SetTitleTextAttributes(new UITextAttributes()
20 | {
21 | TextColor = UIColor.White
22 | });
23 |
24 | LoadApplication(new App());
25 |
26 | return base.FinishedLaunching(app, options);
27 | }
28 | }
29 | }
30 |
31 |
--------------------------------------------------------------------------------
/MultiPokeListView/App.cs:
--------------------------------------------------------------------------------
1 |
2 | using System;
3 |
4 | using Xamarin.Forms;
5 | using MultiPokeListView.ViewModels;
6 | using MultiPokeListView.Pages;
7 |
8 | namespace MultiPokeListView
9 | {
10 | public class App : Application
11 | {
12 | public PokemonsViewModel PokemonsViewModel{ get; private set; }
13 |
14 | public App()
15 | {
16 | PokemonsViewModel = new PokemonsViewModel();
17 |
18 | #if USE_XAML
19 | MainPage = new NavigationPage(new PokemonListXamlPage());
20 | #else
21 | MainPage = new NavigationPage(new PokemonListPage());
22 | #endif
23 |
24 | }
25 |
26 | protected override void OnStart()
27 | {
28 | // Handle when your app starts
29 | }
30 |
31 | protected override void OnSleep()
32 | {
33 | // Handle when your app sleeps
34 | }
35 |
36 | protected override void OnResume()
37 | {
38 | // Handle when your app resumes
39 | }
40 | }
41 | }
42 |
43 |
--------------------------------------------------------------------------------
/MultiPokeListView/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 |
4 | // Information about this assembly is defined by the following attributes.
5 | // Change them to the values specific to your project.
6 |
7 | [assembly: AssemblyTitle("MultiPokeListView")]
8 | [assembly: AssemblyDescription("")]
9 | [assembly: AssemblyConfiguration("")]
10 | [assembly: AssemblyCompany("")]
11 | [assembly: AssemblyProduct("")]
12 | [assembly: AssemblyCopyright("fferegrino")]
13 | [assembly: AssemblyTrademark("")]
14 | [assembly: AssemblyCulture("")]
15 |
16 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
17 | // The form "{Major}.{Minor}.*" will automatically update the build and revision,
18 | // and "{Major}.{Minor}.{Build}.*" will update just the revision.
19 |
20 | [assembly: AssemblyVersion("1.0.*")]
21 |
22 | // The following attributes are used to specify the signing key for the assembly,
23 | // if desired. See the Mono documentation for more information about signing.
24 |
25 | //[assembly: AssemblyDelaySign(false)]
26 | //[assembly: AssemblyKeyFile("")]
27 |
28 |
--------------------------------------------------------------------------------
/Droid/Properties/AssemblyInfo.cs:
--------------------------------------------------------------------------------
1 | using System.Reflection;
2 | using System.Runtime.CompilerServices;
3 | using Android.App;
4 |
5 | // Information about this assembly is defined by the following attributes.
6 | // Change them to the values specific to your project.
7 |
8 | [assembly: AssemblyTitle("MultiSelectListView.Droid")]
9 | [assembly: AssemblyDescription("")]
10 | [assembly: AssemblyConfiguration("")]
11 | [assembly: AssemblyCompany("")]
12 | [assembly: AssemblyProduct("")]
13 | [assembly: AssemblyCopyright("fferegrino")]
14 | [assembly: AssemblyTrademark("")]
15 | [assembly: AssemblyCulture("")]
16 |
17 | // The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
18 | // The form "{Major}.{Minor}.*" will automatically update the build and revision,
19 | // and "{Major}.{Minor}.{Build}.*" will update just the revision.
20 |
21 | [assembly: AssemblyVersion("1.0.0")]
22 |
23 | // The following attributes are used to specify the signing key for the assembly,
24 | // if desired. See the Mono documentation for more information about signing.
25 |
26 | //[assembly: AssemblyDelaySign(false)]
27 | //[assembly: AssemblyKeyFile("")]
28 |
29 |
--------------------------------------------------------------------------------
/MultiPokeListView/Pages/PokemonListPage.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Xamarin.Forms;
4 | using MultiPokeListView.ViewModels;
5 | using MultiPokeListView.Controls;
6 |
7 | namespace MultiPokeListView.Pages
8 | {
9 | public class PokemonListPage : ContentPage
10 | {
11 | public PokemonListPage()
12 | {
13 | BindingContext = (App.Current as App).PokemonsViewModel;
14 | Title = "Pokemon";
15 |
16 | var list = new ListView();
17 | list.SetBinding(ListView.ItemsSourceProperty, "Pokemons");
18 |
19 | var template = new DataTemplate(typeof(PokemonSelectableCell));
20 | template.SetBinding(PokemonSelectableCell.NameProperty, "Item.Name");
21 | template.SetBinding(PokemonSelectableCell.WeightProperty, "Item.Weight");
22 | template.SetBinding(PokemonSelectableCell.HeightProperty, "Item.Height");
23 | list.ItemTemplate = template;
24 |
25 | var getSelectedItemsButton = new ToolbarItem()
26 | {
27 | Text = "Elegir"
28 | };
29 | getSelectedItemsButton.SetBinding(ToolbarItem.CommandProperty, "GetSelectedItemsCommand");
30 | ToolbarItems.Add(getSelectedItemsButton);
31 |
32 | Content = list;
33 | }
34 | }
35 | }
36 |
37 |
38 |
--------------------------------------------------------------------------------
/iOS/Info.plist:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 | CFBundleDisplayName
6 | multiselect-listview
7 | CFBundleIdentifier
8 | com.thatcsharpguy.multiselect-listview
9 | CFBundleShortVersionString
10 | 1.0
11 | CFBundleVersion
12 | 1.0
13 | LSRequiresIPhoneOS
14 |
15 | MinimumOSVersion
16 | 7.0
17 | UIDeviceFamily
18 |
19 | 1
20 | 2
21 |
22 | UILaunchStoryboardName
23 | LaunchScreen
24 | UIRequiredDeviceCapabilities
25 |
26 | armv7
27 |
28 | UISupportedInterfaceOrientations
29 |
30 | UIInterfaceOrientationPortrait
31 | UIInterfaceOrientationLandscapeLeft
32 | UIInterfaceOrientationLandscapeRight
33 |
34 | UISupportedInterfaceOrientations~ipad
35 |
36 | UIInterfaceOrientationPortrait
37 | UIInterfaceOrientationPortraitUpsideDown
38 | UIInterfaceOrientationLandscapeLeft
39 | UIInterfaceOrientationLandscapeRight
40 |
41 | XSAppIconAssets
42 | Resources/Images.xcassets/AppIcons.appiconset
43 |
44 |
45 |
46 |
--------------------------------------------------------------------------------
/Droid/Resources/Resource.designer.cs:
--------------------------------------------------------------------------------
1 | #pragma warning disable 1591
2 | // ------------------------------------------------------------------------------
3 | //
4 | // This code was generated by a tool.
5 | // Mono Runtime Version: 4.6.57.0
6 | //
7 | // Changes to this file may cause incorrect behavior and will be lost if
8 | // the code is regenerated.
9 | //
10 | // ------------------------------------------------------------------------------
11 |
12 | [assembly: Android.Runtime.ResourceDesignerAttribute("MultiPokeListView.Droid.Resource", IsApplication=true)]
13 |
14 | namespace MultiPokeListView.Droid
15 | {
16 |
17 |
18 | [System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
19 | public partial class Resource
20 | {
21 |
22 | static Resource()
23 | {
24 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
25 | }
26 |
27 | public static void UpdateIdValues()
28 | {
29 | }
30 |
31 | public partial class Attribute
32 | {
33 |
34 | static Attribute()
35 | {
36 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
37 | }
38 |
39 | private Attribute()
40 | {
41 | }
42 | }
43 |
44 | public partial class Drawable
45 | {
46 |
47 | // aapt resource value: 0x7f020000
48 | public const int icon = 2130837504;
49 |
50 | static Drawable()
51 | {
52 | global::Android.Runtime.ResourceIdManager.UpdateIdValues();
53 | }
54 |
55 | private Drawable()
56 | {
57 | }
58 | }
59 | }
60 | }
61 | #pragma warning restore 1591
62 |
--------------------------------------------------------------------------------
/Droid/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.axml),
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/
12 | icon.png
13 |
14 | layout/
15 | main.axml
16 |
17 | values/
18 | strings.xml
19 |
20 | In order to get the build system to recognize Android resources, set the build action to
21 | "AndroidResource". The native Android APIs do not operate directly with filenames, but
22 | instead operate on resource IDs. When you compile an Android application that uses resources,
23 | the build system will package the resources for distribution and generate a class called "R"
24 | (this is an Android convention) that contains the tokens for each one of the resources
25 | included. For example, for the above Resources layout, this is what the R class would expose:
26 |
27 | public class R {
28 | public class drawable {
29 | public const int icon = 0x123;
30 | }
31 |
32 | public class layout {
33 | public const int main = 0x456;
34 | }
35 |
36 | public class strings {
37 | public const int first_string = 0xabc;
38 | public const int second_string = 0xbcd;
39 | }
40 | }
41 |
42 | You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
43 | to reference the layout/main.axml file, or R.strings.first_string to reference the first
44 | string in the dictionary file values/strings.xml.
45 |
--------------------------------------------------------------------------------
/iOS/Resources/Images.xcassets/AppIcons.appiconset/Contents.json:
--------------------------------------------------------------------------------
1 | {
2 | "images": [
3 | {
4 | "size": "29x29",
5 | "scale": "1x",
6 | "idiom": "iphone"
7 | },
8 | {
9 | "size": "29x29",
10 | "scale": "2x",
11 | "idiom": "iphone"
12 | },
13 | {
14 | "size": "29x29",
15 | "scale": "3x",
16 | "idiom": "iphone"
17 | },
18 | {
19 | "size": "40x40",
20 | "scale": "2x",
21 | "idiom": "iphone"
22 | },
23 | {
24 | "size": "40x40",
25 | "scale": "3x",
26 | "idiom": "iphone"
27 | },
28 | {
29 | "size": "57x57",
30 | "scale": "1x",
31 | "idiom": "iphone"
32 | },
33 | {
34 | "size": "57x57",
35 | "scale": "2x",
36 | "idiom": "iphone"
37 | },
38 | {
39 | "size": "60x60",
40 | "scale": "2x",
41 | "idiom": "iphone"
42 | },
43 | {
44 | "size": "60x60",
45 | "scale": "3x",
46 | "idiom": "iphone"
47 | },
48 | {
49 | "size": "29x29",
50 | "scale": "1x",
51 | "idiom": "ipad"
52 | },
53 | {
54 | "size": "29x29",
55 | "scale": "2x",
56 | "idiom": "ipad"
57 | },
58 | {
59 | "size": "40x40",
60 | "scale": "1x",
61 | "idiom": "ipad"
62 | },
63 | {
64 | "size": "40x40",
65 | "scale": "2x",
66 | "idiom": "ipad"
67 | },
68 | {
69 | "size": "50x50",
70 | "scale": "1x",
71 | "idiom": "ipad"
72 | },
73 | {
74 | "size": "50x50",
75 | "scale": "2x",
76 | "idiom": "ipad"
77 | },
78 | {
79 | "size": "72x72",
80 | "scale": "1x",
81 | "idiom": "ipad"
82 | },
83 | {
84 | "size": "72x72",
85 | "scale": "2x",
86 | "idiom": "ipad"
87 | },
88 | {
89 | "size": "76x76",
90 | "scale": "1x",
91 | "idiom": "ipad"
92 | },
93 | {
94 | "size": "76x76",
95 | "scale": "2x",
96 | "idiom": "ipad"
97 | },
98 | {
99 | "size": "120x120",
100 | "scale": "1x",
101 | "idiom": "car"
102 | }
103 | ],
104 | "info": {
105 | "version": 1,
106 | "author": "xcode"
107 | }
108 | }
--------------------------------------------------------------------------------
/MultiPokeListView/Controls/CheckBox.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Assembly : XLabs.Forms
3 | // Author : XLabs Team
4 | // Created : 12-27-2015
5 | //
6 | // Last Modified By : XLabs Team
7 | // Last Modified On : 01-04-2016
8 | // ***********************************************************************
9 | //
10 | // Copyright (c) XLabs Team. All rights reserved.
11 | //
12 | //
13 | // This project is licensed under the Apache 2.0 license
14 | // https://github.com/XLabs/Xamarin-Forms-Labs/blob/master/LICENSE
15 | //
16 | // XLabs is a open source project that aims to provide a powerfull and cross
17 | // platform set of controls tailored to work with Xamarin Forms.
18 | //
19 | // ***********************************************************************
20 | //
21 |
22 | using System;
23 | using Xamarin.Forms;
24 |
25 | namespace MultiPokeListView.Controls
26 | {
27 | ///
28 | /// The check box.
29 | ///
30 | public class CheckBox : View
31 | {
32 | ///
33 | /// The checked state property.
34 | ///
35 | public static readonly BindableProperty CheckedProperty =
36 | BindableProperty.Create ("Checked",
37 | typeof(bool),
38 | typeof(CheckBox),
39 | false, BindingMode.TwoWay,propertyChanged: OnCheckedPropertyChanged);
40 |
41 |
42 | ///
43 | /// Gets or sets a value indicating whether the control is checked.
44 | ///
45 | /// The checked state.
46 | public bool Checked
47 | {
48 | get
49 | {
50 | return (bool)GetValue(CheckedProperty);
51 | }
52 |
53 | set
54 | {
55 | if(this.Checked != value) {
56 | this.SetValue(CheckedProperty, value);
57 | //this.CheckedChanged.Invoke(this, new EventArgs(value));
58 | }
59 | }
60 | }
61 |
62 |
63 |
64 | ///
65 | /// Called when [checked property changed].
66 | ///
67 | /// The bindable.
68 | /// if set to true [oldvalue].
69 | /// if set to true [newvalue].
70 | private static void OnCheckedPropertyChanged(BindableObject bindable, object oldvalue, object newvalue)
71 | {
72 | var checkBox = (CheckBox) bindable;
73 | checkBox.Checked = (bool)newvalue;
74 | }
75 | }
76 | }
--------------------------------------------------------------------------------
/iOS/Resources/LaunchScreen.xib:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 |
5 |
6 |
7 |
8 |
9 |
10 |
11 |
12 |
13 |
14 |
21 |
28 |
29 |
30 |
31 |
32 |
33 |
34 |
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
--------------------------------------------------------------------------------
/MultiPokeListView/Controls/PokemonSelectableCell.cs:
--------------------------------------------------------------------------------
1 | using System;
2 |
3 | using Xamarin.Forms;
4 |
5 | namespace MultiPokeListView.Controls
6 | {
7 | public class PokemonSelectableCell : ViewCell
8 | {
9 | public static readonly BindableProperty NameProperty =
10 | BindableProperty.Create ("Name", typeof(string), typeof(PokemonSelectableCell), "Charmander");
11 |
12 | public static readonly BindableProperty WeightProperty =
13 | BindableProperty.Create ("Weight", typeof(double), typeof(PokemonSelectableCell), 8.5D);
14 |
15 | public static readonly BindableProperty HeightProperty =
16 | BindableProperty.Create ("Height", typeof(double), typeof(PokemonSelectableCell), 0.6D);
17 |
18 | public string Name {
19 | get { return(string)GetValue (NameProperty); }
20 | set { SetValue (NameProperty, value); }
21 | }
22 |
23 | public double Weight {
24 | get { return(double)GetValue (WeightProperty); }
25 | set { SetValue (WeightProperty, value); }
26 | }
27 |
28 | public double Height {
29 | get { return(double)GetValue (HeightProperty); }
30 | set { SetValue (HeightProperty, value); }
31 | }
32 |
33 | Label lbName, lbWeight, lbHeight;
34 |
35 | public PokemonSelectableCell()
36 | {
37 | lbName = new Label{ HorizontalOptions = LayoutOptions.StartAndExpand };
38 | lbWeight = new Label{ HorizontalOptions = LayoutOptions.EndAndExpand };;
39 | lbHeight = new Label{ HorizontalOptions = LayoutOptions.EndAndExpand };;
40 |
41 | Grid infoLayout = new Grid
42 | {
43 | ColumnDefinitions =
44 | {
45 | new ColumnDefinition { Width = new GridLength(3,GridUnitType.Star) },
46 | new ColumnDefinition { Width = new GridLength(1,GridUnitType.Star) },
47 | new ColumnDefinition { Width = new GridLength(1,GridUnitType.Star) }
48 | },
49 | HorizontalOptions = LayoutOptions.FillAndExpand
50 | };
51 |
52 | infoLayout.Children.Add(lbName,0,0);
53 | infoLayout.Children.Add(lbWeight,1,0);
54 | infoLayout.Children.Add(lbHeight,2,0);
55 |
56 | var cellWrapper = new Grid
57 | {
58 | Padding = 10,
59 | ColumnDefinitions =
60 | {
61 | new ColumnDefinition { Width = new GridLength(1,GridUnitType.Auto) },
62 | new ColumnDefinition { Width = new GridLength(1,GridUnitType.Star) },
63 | }
64 | };
65 |
66 | //var cb = new CheckBox();
67 | //cellWrapper.Children.Add(cb, 0, 0);
68 | var sw = new Switch();
69 | sw.SetBinding(Switch.IsToggledProperty, "IsSelected");
70 |
71 | cellWrapper.Children.Add(sw, 0, 0);
72 | cellWrapper.Children.Add(infoLayout, 1, 0);
73 |
74 | View = cellWrapper;
75 | }
76 |
77 | protected override void OnBindingContextChanged ()
78 | {
79 | base.OnBindingContextChanged ();
80 |
81 | if (BindingContext != null) {
82 | lbName.Text = Name;
83 | lbWeight.Text = Weight.ToString() + " kg";
84 | lbHeight.Text = Height.ToString() + " m";
85 | }
86 | }
87 | }
88 | }
89 |
90 |
91 |
--------------------------------------------------------------------------------
/MultiPokeListView/MultiPokeListView.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
7 | {83EE13E9-E825-4B40-A032-7F7E8996A5EC}
8 | Library
9 | MultiPokeListView
10 | MultiSelectListView
11 | v4.5
12 | Profile78
13 |
14 |
15 | true
16 | full
17 | false
18 | bin\Debug
19 | DEBUG;
20 | prompt
21 | 4
22 | false
23 |
24 |
25 | full
26 | true
27 | bin\Release
28 | prompt
29 | 4
30 | false
31 |
32 |
33 |
34 | PokemonListXamlPage.xaml
35 |
36 |
37 |
38 |
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 |
47 |
48 |
49 |
50 |
51 | ..\packages\Xamarin.Forms.2.1.0.6529\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Core.dll
52 |
53 |
54 | ..\packages\Xamarin.Forms.2.1.0.6529\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Platform.dll
55 |
56 |
57 | ..\packages\Xamarin.Forms.2.1.0.6529\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Xaml.dll
58 |
59 |
60 |
61 |
62 |
63 |
64 |
65 | Designer
66 | MSBuild:UpdateDesignTimeXaml
67 |
68 |
69 |
--------------------------------------------------------------------------------
/iOS/Controls/CheckBoxRenderer.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Assembly : XLabs.Forms.iOS
3 | // Author : XLabs Team
4 | // Created : 01-06-2016
5 | //
6 | // Last Modified By : XLabs Team
7 | // Last Modified On : 01-06-2016
8 | // ***********************************************************************
9 | //
10 | // Copyright (c) XLabs Team. All rights reserved.
11 | //
12 | //
13 | // This project is licensed under the Apache 2.0 license
14 | // https://github.com/XLabs/Xamarin-Forms-Labs/blob/master/LICENSE
15 | //
16 | // XLabs is a open source project that aims to provide a powerfull and cross
17 | // platform set of controls tailored to work with Xamarin Forms.
18 | //
19 | // ***********************************************************************
20 | //
21 |
22 | using System;
23 | using System.ComponentModel;
24 | using UIKit;
25 | using Xamarin.Forms;
26 | using Xamarin.Forms.Platform.iOS;
27 | using MultiPokeListView.Controls;
28 | using CoreGraphics;
29 | using MultiPokeListView.iOS.Controls;
30 | using System.Diagnostics;
31 |
32 | [assembly: ExportRenderer(typeof(CheckBox), typeof(CheckBoxRenderer))]
33 |
34 | namespace MultiPokeListView.iOS.Controls
35 | {
36 | ///
37 | /// The check box renderer for iOS.
38 | ///
39 | public class CheckBoxRenderer : ViewRenderer
40 | {
41 |
42 | ///
43 | /// Handles the Element Changed event
44 | ///
45 | /// The e.
46 | protected override void OnElementChanged(ElementChangedEventArgs e)
47 | {
48 |
49 | base.OnElementChanged(e);
50 |
51 | if (Element == null) return;
52 |
53 | BackgroundColor = Element.BackgroundColor.ToUIColor();
54 | if (e.NewElement != null)
55 | {
56 | if (Control == null)
57 | {
58 | var checkBox = new CheckBoxView (Bounds);
59 | checkBox.TouchUpInside += (s, args) => Element.Checked = Control.Checked;
60 | SetNativeControl (checkBox);
61 | }
62 | Control.LineBreakMode = UILineBreakMode.CharacterWrap;
63 | Control.VerticalAlignment = UIControlContentVerticalAlignment.Center;
64 | Control.HorizontalAlignment = UIControlContentHorizontalAlignment.Center;
65 | Control.Checked = e.NewElement.Checked;
66 | }
67 |
68 | Control.Frame = Frame;
69 | Control.Bounds = Bounds;
70 | }
71 |
72 |
73 | ///
74 | /// Draws the specified rect.
75 | ///
76 | /// The rect.
77 | public override void Draw(CoreGraphics.CGRect rect)
78 | {
79 | base.Draw(rect);
80 | }
81 |
82 | ///
83 | /// Handles the event.
84 | ///
85 | /// The sender.
86 | /// The instance containing the event data.
87 | protected override void OnElementPropertyChanged(object sender, PropertyChangedEventArgs e)
88 | {
89 | base.OnElementPropertyChanged(sender, e);
90 |
91 | switch (e.PropertyName)
92 | {
93 | case "Checked":
94 | Control.Checked = Element.Checked;
95 | break;
96 | case "Element":
97 | break;
98 | default:
99 | //System.Diagnostics.Debug.WriteLine(String.Format("Property change for {0} has not been implemented.", e.PropertyName));
100 | return;
101 | }
102 | }
103 | }
104 | }
--------------------------------------------------------------------------------
/iOS/Controls/CheckBoxView Che.cs:
--------------------------------------------------------------------------------
1 | // ***********************************************************************
2 | // Assembly : XLabs.Forms.iOS
3 | // Author : XLabs Team
4 | // Created : 01-06-2016
5 | //
6 | // Last Modified By : XLabs Team
7 | // Last Modified On : 01-06-2016
8 | // ***********************************************************************
9 | //
10 | // Copyright (c) XLabs Team. All rights reserved.
11 | //
12 | //
13 | // This project is licensed under the Apache 2.0 license
14 | // https://github.com/XLabs/Xamarin-Forms-Labs/blob/master/LICENSE
15 | //
16 | // XLabs is a open source project that aims to provide a powerfull and cross
17 | // platform set of controls tailored to work with Xamarin Forms.
18 | //
19 | // ***********************************************************************
20 | //
21 |
22 | using CoreGraphics;
23 | using Foundation;
24 | using UIKit;
25 |
26 | namespace MultiPokeListView.iOS.Controls
27 | {
28 | ///
29 | /// Class CheckBoxView.
30 | ///
31 | [Register("CheckBoxView")]
32 | public class CheckBoxView : UIButton
33 | {
34 | ///
35 | /// Initializes a new instance of the class.
36 | ///
37 | public CheckBoxView()
38 | {
39 | Initialize();
40 | }
41 |
42 | ///
43 | /// Initializes a new instance of the class.
44 | ///
45 | /// The bounds.
46 | public CheckBoxView(CGRect bounds) : base(bounds)
47 | {
48 | Initialize();
49 | }
50 |
51 | ///
52 | /// Sets the checked title.
53 | ///
54 | /// The checked title.
55 | public string CheckedTitle
56 | {
57 | set
58 | {
59 | SetTitle(value, UIControlState.Selected);
60 | }
61 | }
62 |
63 | ///
64 | /// Sets the unchecked title.
65 | ///
66 | /// The unchecked title.
67 | public string UncheckedTitle
68 | {
69 | set
70 | {
71 | SetTitle(value, UIControlState.Normal);
72 | }
73 | }
74 |
75 | ///
76 | /// Gets or sets a value indicating whether this is checked.
77 | ///
78 | /// true if checked; otherwise, false.
79 | public bool Checked
80 | {
81 | set { Selected = value; }
82 | get { return Selected; }
83 | }
84 |
85 | ///
86 | /// Initializes this instance.
87 | ///
88 | void Initialize()
89 | {
90 | //AdjustEdgeInsets();
91 | ApplyStyle();
92 |
93 | TouchUpInside += (sender, args) => Selected = !Selected;
94 | // set default color, because type is not UIButtonType.System
95 | SetTitleColor(UIColor.DarkTextColor, UIControlState.Normal);
96 | SetTitleColor(UIColor.DarkTextColor, UIControlState.Selected);
97 | }
98 |
99 | ///
100 | /// Adjusts the edge insets.
101 | ///
102 | void AdjustEdgeInsets()
103 | {
104 | const float Inset = 8f;
105 |
106 | HorizontalAlignment = UIControlContentHorizontalAlignment.Left;
107 | ImageEdgeInsets = new UIEdgeInsets(0f, Inset, 0f, 0f);
108 | TitleEdgeInsets = new UIEdgeInsets(0f, Inset * 2, 0f, 0f);
109 | }
110 |
111 | ///
112 | /// Applies the style.
113 | ///
114 | void ApplyStyle()
115 | {
116 | SetImage(UIImage.FromBundle("checked.png"), UIControlState.Selected);
117 | SetImage(UIImage.FromBundle("unchecked.png"), UIControlState.Normal);
118 | }
119 | }
120 | }
--------------------------------------------------------------------------------
/MultiPokeList.sln:
--------------------------------------------------------------------------------
1 |
2 | Microsoft Visual Studio Solution File, Format Version 12.00
3 | # Visual Studio 2013
4 | VisualStudioVersion = 12.0.40629.0
5 | MinimumVisualStudioVersion = 10.0.40219.1
6 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultiPokeListView", "MultiPokeListView\MultiPokeListView.csproj", "{83EE13E9-E825-4B40-A032-7F7E8996A5EC}"
7 | EndProject
8 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultiPokeListView.iOS", "iOS\MultiPokeListView.iOS.csproj", "{FC0FE0E5-B7FE-4431-8B09-31EB7A9AD578}"
9 | EndProject
10 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "MultiPokeListView.Droid", "Droid\MultiPokeListView.Droid.csproj", "{5EA17347-75F2-48BA-AE8D-04CCBD4895B3}"
11 | EndProject
12 | Global
13 | GlobalSection(SolutionConfigurationPlatforms) = preSolution
14 | Debug|Any CPU = Debug|Any CPU
15 | Debug|iPhone = Debug|iPhone
16 | Debug|iPhoneSimulator = Debug|iPhoneSimulator
17 | Release|Any CPU = Release|Any CPU
18 | Release|iPhone = Release|iPhone
19 | Release|iPhoneSimulator = Release|iPhoneSimulator
20 | EndGlobalSection
21 | GlobalSection(ProjectConfigurationPlatforms) = postSolution
22 | {83EE13E9-E825-4B40-A032-7F7E8996A5EC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
23 | {83EE13E9-E825-4B40-A032-7F7E8996A5EC}.Debug|Any CPU.Build.0 = Debug|Any CPU
24 | {83EE13E9-E825-4B40-A032-7F7E8996A5EC}.Debug|iPhone.ActiveCfg = Debug|Any CPU
25 | {83EE13E9-E825-4B40-A032-7F7E8996A5EC}.Debug|iPhone.Build.0 = Debug|Any CPU
26 | {83EE13E9-E825-4B40-A032-7F7E8996A5EC}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
27 | {83EE13E9-E825-4B40-A032-7F7E8996A5EC}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
28 | {83EE13E9-E825-4B40-A032-7F7E8996A5EC}.Release|Any CPU.ActiveCfg = Release|Any CPU
29 | {83EE13E9-E825-4B40-A032-7F7E8996A5EC}.Release|Any CPU.Build.0 = Release|Any CPU
30 | {83EE13E9-E825-4B40-A032-7F7E8996A5EC}.Release|iPhone.ActiveCfg = Release|Any CPU
31 | {83EE13E9-E825-4B40-A032-7F7E8996A5EC}.Release|iPhone.Build.0 = Release|Any CPU
32 | {83EE13E9-E825-4B40-A032-7F7E8996A5EC}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
33 | {83EE13E9-E825-4B40-A032-7F7E8996A5EC}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
34 | {FC0FE0E5-B7FE-4431-8B09-31EB7A9AD578}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
35 | {FC0FE0E5-B7FE-4431-8B09-31EB7A9AD578}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
36 | {FC0FE0E5-B7FE-4431-8B09-31EB7A9AD578}.Debug|iPhone.ActiveCfg = Debug|iPhone
37 | {FC0FE0E5-B7FE-4431-8B09-31EB7A9AD578}.Debug|iPhone.Build.0 = Debug|iPhone
38 | {FC0FE0E5-B7FE-4431-8B09-31EB7A9AD578}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
39 | {FC0FE0E5-B7FE-4431-8B09-31EB7A9AD578}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
40 | {FC0FE0E5-B7FE-4431-8B09-31EB7A9AD578}.Release|Any CPU.ActiveCfg = Release|iPhone
41 | {FC0FE0E5-B7FE-4431-8B09-31EB7A9AD578}.Release|Any CPU.Build.0 = Release|iPhone
42 | {FC0FE0E5-B7FE-4431-8B09-31EB7A9AD578}.Release|iPhone.ActiveCfg = Release|iPhone
43 | {FC0FE0E5-B7FE-4431-8B09-31EB7A9AD578}.Release|iPhone.Build.0 = Release|iPhone
44 | {FC0FE0E5-B7FE-4431-8B09-31EB7A9AD578}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
45 | {FC0FE0E5-B7FE-4431-8B09-31EB7A9AD578}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
46 | {5EA17347-75F2-48BA-AE8D-04CCBD4895B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
47 | {5EA17347-75F2-48BA-AE8D-04CCBD4895B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
48 | {5EA17347-75F2-48BA-AE8D-04CCBD4895B3}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
49 | {5EA17347-75F2-48BA-AE8D-04CCBD4895B3}.Debug|iPhone.ActiveCfg = Debug|Any CPU
50 | {5EA17347-75F2-48BA-AE8D-04CCBD4895B3}.Debug|iPhone.Build.0 = Debug|Any CPU
51 | {5EA17347-75F2-48BA-AE8D-04CCBD4895B3}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
52 | {5EA17347-75F2-48BA-AE8D-04CCBD4895B3}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
53 | {5EA17347-75F2-48BA-AE8D-04CCBD4895B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
54 | {5EA17347-75F2-48BA-AE8D-04CCBD4895B3}.Release|Any CPU.Build.0 = Release|Any CPU
55 | {5EA17347-75F2-48BA-AE8D-04CCBD4895B3}.Release|iPhone.ActiveCfg = Release|Any CPU
56 | {5EA17347-75F2-48BA-AE8D-04CCBD4895B3}.Release|iPhone.Build.0 = Release|Any CPU
57 | {5EA17347-75F2-48BA-AE8D-04CCBD4895B3}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
58 | {5EA17347-75F2-48BA-AE8D-04CCBD4895B3}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
59 | EndGlobalSection
60 | GlobalSection(SolutionProperties) = preSolution
61 | HideSolutionNode = FALSE
62 | EndGlobalSection
63 | GlobalSection(MonoDevelopProperties) = preSolution
64 | Policies = $0
65 | $0.DotNetNamingPolicy = $1
66 | $1.DirectoryNamespaceAssociation = PrefixedHierarchical
67 | $1.ResourceNamePolicy = FileFormatDefault
68 | EndGlobalSection
69 | EndGlobal
70 |
--------------------------------------------------------------------------------
/Droid/MultiPokeListView.Droid.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | AnyCPU
6 | {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
7 | {5EA17347-75F2-48BA-AE8D-04CCBD4895B3}
8 | Library
9 | MultiPokeListView.Droid
10 | Assets
11 | Resources
12 | Resource
13 | Resources\Resource.designer.cs
14 | True
15 | True
16 | MultiSelectListView.Droid
17 | Properties\AndroidManifest.xml
18 | v6.0
19 |
20 |
21 | true
22 | full
23 | false
24 | bin\Debug
25 | DEBUG;
26 | prompt
27 | 4
28 | None
29 | false
30 |
31 |
32 | full
33 | true
34 | bin\Release
35 | prompt
36 | 4
37 | false
38 | false
39 |
40 |
41 |
42 |
43 |
44 |
45 |
46 | ..\packages\Xamarin.Android.Support.v4.21.0.3.0\lib\MonoAndroid10\Xamarin.Android.Support.v4.dll
47 |
48 |
49 | ..\packages\Xamarin.Forms.1.3.5.6335\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll
50 |
51 |
52 | ..\packages\Xamarin.Forms.1.3.5.6335\lib\MonoAndroid10\FormsViewGroup.dll
53 |
54 |
55 | ..\packages\Xamarin.Forms.1.3.5.6335\lib\MonoAndroid10\Xamarin.Forms.Core.dll
56 |
57 |
58 | ..\packages\Xamarin.Forms.1.3.5.6335\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll
59 |
60 |
61 |
62 |
63 | {83EE13E9-E825-4B40-A032-7F7E8996A5EC}
64 | MultiPokeListView
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 |
--------------------------------------------------------------------------------
/iOS/MultiPokeListView.iOS.csproj:
--------------------------------------------------------------------------------
1 |
2 |
3 |
4 | Debug
5 | iPhoneSimulator
6 | {FEACFBD2-3405-455C-9665-78FE426C6842};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}
7 | {FC0FE0E5-B7FE-4431-8B09-31EB7A9AD578}
8 | Exe
9 | MultiPokeListView.iOS
10 | Resources
11 | MultiSelectListView.iOS
12 |
13 |
14 | true
15 | full
16 | false
17 | bin\iPhoneSimulator\Debug
18 | DEBUG;ENABLE_TEST_CLOUD;
19 | prompt
20 | 4
21 | false
22 | i386
23 | None
24 | true
25 | true
26 | true
27 | true
28 | iPhone Developer
29 | true
30 |
31 |
32 | full
33 | true
34 | bin\iPhone\Release
35 | prompt
36 | 4
37 | false
38 | ARMv7, ARM64
39 | Entitlements.plist
40 | true
41 | true
42 | iPhone Developer
43 | true
44 |
45 |
46 | full
47 | true
48 | bin\iPhoneSimulator\Release
49 | prompt
50 | 4
51 | false
52 | i386
53 | None
54 | true
55 | iPhone Developer
56 | true
57 |
58 |
59 | true
60 | full
61 | false
62 | bin\iPhone\Debug
63 | DEBUG;ENABLE_TEST_CLOUD;
64 | prompt
65 | 4
66 | false
67 | ARMv7, ARM64
68 | Entitlements.plist
69 | true
70 | iPhone Developer
71 | true
72 | true
73 | true
74 | true
75 | true
76 |
77 |
78 |
79 |
80 |
81 |
82 |
83 | ..\packages\Xamarin.Forms.1.3.5.6335\lib\Xamarin.iOS10\Xamarin.Forms.Platform.iOS.dll
84 |
85 |
86 | ..\packages\Xamarin.Forms.1.3.5.6335\lib\Xamarin.iOS10\Xamarin.Forms.Core.dll
87 |
88 |
89 | ..\packages\Xamarin.Forms.1.3.5.6335\lib\Xamarin.iOS10\Xamarin.Forms.Xaml.dll
90 |
91 |
92 |
93 |
94 | {83EE13E9-E825-4B40-A032-7F7E8996A5EC}
95 | MultiPokeListView
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 |
126 |
127 |
128 |
--------------------------------------------------------------------------------
/MultiPokeListView/ViewModels/PokemonsViewModel.cs:
--------------------------------------------------------------------------------
1 | using System;
2 | using System.Linq;
3 | using System.Collections.ObjectModel;
4 | using System.ComponentModel;
5 | using System.Runtime.CompilerServices;
6 | using System.Collections.Generic;
7 | using System.Windows.Input;
8 | using Xamarin.Forms;
9 | using MultiPokeListView.Pages;
10 |
11 | namespace MultiPokeListView.ViewModels
12 | {
13 | public class PokemonsViewModel : INotifyPropertyChanged
14 | {
15 | public PokemonsViewModel()
16 | {
17 | var pokemones = new List()
18 | {
19 | #region Pokemons
20 | new Pokemon { Id = 1, Name = "Bulbasaur", Height = 0.7, Weight = 6.9 },
21 | new Pokemon { Id = 2, Name = "Ivysaur", Height = 1, Weight = 13 },
22 | new Pokemon { Id = 3, Name = "Venusaur", Height = 2, Weight = 100 },
23 | new Pokemon { Id = 4, Name = "Charmander", Height = 0.6, Weight = 8.5 },
24 | new Pokemon { Id = 5, Name = "Charmeleon", Height = 1.1, Weight = 19 },
25 | new Pokemon { Id = 6, Name = "Charizard", Height = 1.7, Weight = 90.5 },
26 | new Pokemon { Id = 7, Name = "Squirtle", Height = 0.5, Weight = 9 },
27 | new Pokemon { Id = 8, Name = "Wartortle", Height = 1, Weight = 22.5 },
28 | new Pokemon { Id = 9, Name = "Blastoise", Height = 1.6, Weight = 85.5 },
29 | new Pokemon { Id = 10, Name = "Caterpie", Height = 0.3, Weight = 2.9 },
30 | new Pokemon { Id = 11, Name = "Metapod", Height = 0.7, Weight = 9.9 },
31 | new Pokemon { Id = 12, Name = "Butterfree", Height = 1.1, Weight = 32 },
32 | new Pokemon { Id = 13, Name = "Weedle", Height = 0.3, Weight = 3.2 },
33 | new Pokemon { Id = 14, Name = "Kakuna", Height = 0.6, Weight = 10 },
34 | new Pokemon { Id = 15, Name = "Beedrill", Height = 1, Weight = 29.5 },
35 | new Pokemon { Id = 16, Name = "Pidgey", Height = 0.3, Weight = 1.8 },
36 | new Pokemon { Id = 17, Name = "Pidgeotto", Height = 1.1, Weight = 30 },
37 | new Pokemon { Id = 18, Name = "Pidgeot", Height = 1.5, Weight = 39.5 },
38 | new Pokemon { Id = 19, Name = "Rattata", Height = 0.3, Weight = 3.5 },
39 | new Pokemon { Id = 20, Name = "Raticate", Height = 0.7, Weight = 18.5 },
40 | new Pokemon { Id = 21, Name = "Spearow", Height = 0.3, Weight = 2 },
41 | new Pokemon { Id = 22, Name = "Fearow", Height = 1.2, Weight = 38 },
42 | new Pokemon { Id = 23, Name = "Ekans", Height = 2, Weight = 6.9 },
43 | new Pokemon { Id = 24, Name = "Arbok", Height = 3.5, Weight = 65 },
44 | new Pokemon { Id = 25, Name = "Pikachu", Height = 0.4, Weight = 6 },
45 | new Pokemon { Id = 26, Name = "Raichu", Height = 0.8, Weight = 30 },
46 | new Pokemon { Id = 27, Name = "Sandshrew", Height = 0.6, Weight = 12 },
47 | new Pokemon { Id = 28, Name = "Sandslash", Height = 1, Weight = 29.5 },
48 | new Pokemon { Id = 29, Name = "Nidoran-F", Height = 0.4, Weight = 7 },
49 | new Pokemon { Id = 30, Name = "Nidorina", Height = 0.8, Weight = 20 },
50 | new Pokemon { Id = 31, Name = "Nidoqueen", Height = 1.3, Weight = 60 },
51 | new Pokemon { Id = 32, Name = "Nidoran-M", Height = 0.5, Weight = 9 },
52 | new Pokemon { Id = 33, Name = "Nidorino", Height = 0.9, Weight = 19.5 },
53 | new Pokemon { Id = 34, Name = "Nidoking", Height = 1.4, Weight = 62 },
54 | new Pokemon { Id = 35, Name = "Clefairy", Height = 0.6, Weight = 7.5 },
55 | new Pokemon { Id = 36, Name = "Clefable", Height = 1.3, Weight = 40 },
56 | new Pokemon { Id = 37, Name = "Vulpix", Height = 0.6, Weight = 9.9 },
57 | new Pokemon { Id = 38, Name = "Ninetales", Height = 1.1, Weight = 19.9 },
58 | new Pokemon { Id = 39, Name = "Jigglypuff", Height = 0.5, Weight = 5.5 },
59 | new Pokemon { Id = 40, Name = "Wigglytuff", Height = 1, Weight = 12 },
60 | new Pokemon { Id = 41, Name = "Zubat", Height = 0.8, Weight = 7.5 },
61 | new Pokemon { Id = 42, Name = "Golbat", Height = 1.6, Weight = 55 },
62 | new Pokemon { Id = 43, Name = "Oddish", Height = 0.5, Weight = 5.4 },
63 | new Pokemon { Id = 44, Name = "Gloom", Height = 0.8, Weight = 8.6 },
64 | new Pokemon { Id = 45, Name = "Vileplume", Height = 1.2, Weight = 18.6 },
65 | new Pokemon { Id = 46, Name = "Paras", Height = 0.3, Weight = 5.4 },
66 | new Pokemon { Id = 47, Name = "Parasect", Height = 1, Weight = 29.5 },
67 | new Pokemon { Id = 48, Name = "Venonat", Height = 1, Weight = 30 },
68 | new Pokemon { Id = 49, Name = "Venomoth", Height = 1.5, Weight = 12.5 },
69 | new Pokemon { Id = 50, Name = "Diglett", Height = 0.2, Weight = 0.8 },
70 | new Pokemon { Id = 51, Name = "Dugtrio", Height = 0.7, Weight = 33.3 },
71 | new Pokemon { Id = 52, Name = "Meowth", Height = 0.4, Weight = 4.2 },
72 | new Pokemon { Id = 53, Name = "Persian", Height = 1, Weight = 32 },
73 | new Pokemon { Id = 54, Name = "Psyduck", Height = 0.8, Weight = 19.6 },
74 | new Pokemon { Id = 55, Name = "Golduck", Height = 1.7, Weight = 76.6 },
75 | #endregion
76 | };
77 |
78 | Pokemons = new ObservableCollection>(pokemones
79 | .Select(pk => new SelectableItemWrapper { Item = pk }));
80 | }
81 |
82 | private ObservableCollection> _pokemons;
83 | public ObservableCollection> Pokemons
84 | {
85 | get { return _pokemons; }
86 | set { _pokemons = value; RaisePropertyChanged(); }
87 | }
88 |
89 | private ObservableCollection _selectedPokemons;
90 | public ObservableCollection SelectedPokemons
91 | {
92 | get { return _selectedPokemons ?? new ObservableCollection(); }
93 | private set { _selectedPokemons = value; RaisePropertyChanged(); }
94 | }
95 |
96 | #region Commands
97 |
98 | private ICommand _getSelectedItemsCommand;
99 | public ICommand GetSelectedItemsCommand
100 | {
101 | get
102 | {
103 | return _getSelectedItemsCommand ??
104 | (_getSelectedItemsCommand = new Command(
105 | async () =>
106 | {
107 | SelectedPokemons = GetSelectedPokemons();
108 | // Navigation is not
109 | await App.Current.MainPage.Navigation.PushAsync(new SelectedPokemonPage());
110 | }));
111 | }
112 | }
113 |
114 | #endregion
115 |
116 |
117 | #region INotifyPropertyChanged implementation
118 |
119 | public event PropertyChangedEventHandler PropertyChanged;
120 |
121 | #endregion
122 |
123 | ObservableCollection GetSelectedPokemons()
124 | {
125 | var selected = Pokemons
126 | .Where(p => p.IsSelected)
127 | .Select(p => p.Item)
128 | .ToList();
129 | return new ObservableCollection(selected);
130 | }
131 |
132 | void SelectAll(bool select)
133 | {
134 | foreach (var p in Pokemons)
135 | {
136 | p.IsSelected = select;
137 | }
138 | }
139 |
140 | void RaisePropertyChanged([CallerMemberName] string propertyName = null)
141 | {
142 | if (PropertyChanged != null)
143 | {
144 | PropertyChanged(this, new PropertyChangedEventArgs(propertyName));
145 | }
146 | }
147 | }
148 | }
149 |
150 |
151 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | Apache License
2 | Version 2.0, January 2004
3 | http://www.apache.org/licenses/
4 |
5 | TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
6 |
7 | 1. Definitions.
8 |
9 | "License" shall mean the terms and conditions for use, reproduction,
10 | and distribution as defined by Sections 1 through 9 of this document.
11 |
12 | "Licensor" shall mean the copyright owner or entity authorized by
13 | the copyright owner that is granting the License.
14 |
15 | "Legal Entity" shall mean the union of the acting entity and all
16 | other entities that control, are controlled by, or are under common
17 | control with that entity. For the purposes of this definition,
18 | "control" means (i) the power, direct or indirect, to cause the
19 | direction or management of such entity, whether by contract or
20 | otherwise, or (ii) ownership of fifty percent (50%) or more of the
21 | outstanding shares, or (iii) beneficial ownership of such entity.
22 |
23 | "You" (or "Your") shall mean an individual or Legal Entity
24 | exercising permissions granted by this License.
25 |
26 | "Source" form shall mean the preferred form for making modifications,
27 | including but not limited to software source code, documentation
28 | source, and configuration files.
29 |
30 | "Object" form shall mean any form resulting from mechanical
31 | transformation or translation of a Source form, including but
32 | not limited to compiled object code, generated documentation,
33 | and conversions to other media types.
34 |
35 | "Work" shall mean the work of authorship, whether in Source or
36 | Object form, made available under the License, as indicated by a
37 | copyright notice that is included in or attached to the work
38 | (an example is provided in the Appendix below).
39 |
40 | "Derivative Works" shall mean any work, whether in Source or Object
41 | form, that is based on (or derived from) the Work and for which the
42 | editorial revisions, annotations, elaborations, or other modifications
43 | represent, as a whole, an original work of authorship. For the purposes
44 | of this License, Derivative Works shall not include works that remain
45 | separable from, or merely link (or bind by name) to the interfaces of,
46 | the Work and Derivative Works thereof.
47 |
48 | "Contribution" shall mean any work of authorship, including
49 | the original version of the Work and any modifications or additions
50 | to that Work or Derivative Works thereof, that is intentionally
51 | submitted to Licensor for inclusion in the Work by the copyright owner
52 | or by an individual or Legal Entity authorized to submit on behalf of
53 | the copyright owner. For the purposes of this definition, "submitted"
54 | means any form of electronic, verbal, or written communication sent
55 | to the Licensor or its representatives, including but not limited to
56 | communication on electronic mailing lists, source code control systems,
57 | and issue tracking systems that are managed by, or on behalf of, the
58 | Licensor for the purpose of discussing and improving the Work, but
59 | excluding communication that is conspicuously marked or otherwise
60 | designated in writing by the copyright owner as "Not a Contribution."
61 |
62 | "Contributor" shall mean Licensor and any individual or Legal Entity
63 | on behalf of whom a Contribution has been received by Licensor and
64 | subsequently incorporated within the Work.
65 |
66 | 2. Grant of Copyright License. Subject to the terms and conditions of
67 | this License, each Contributor hereby grants to You a perpetual,
68 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
69 | copyright license to reproduce, prepare Derivative Works of,
70 | publicly display, publicly perform, sublicense, and distribute the
71 | Work and such Derivative Works in Source or Object form.
72 |
73 | 3. Grant of Patent License. Subject to the terms and conditions of
74 | this License, each Contributor hereby grants to You a perpetual,
75 | worldwide, non-exclusive, no-charge, royalty-free, irrevocable
76 | (except as stated in this section) patent license to make, have made,
77 | use, offer to sell, sell, import, and otherwise transfer the Work,
78 | where such license applies only to those patent claims licensable
79 | by such Contributor that are necessarily infringed by their
80 | Contribution(s) alone or by combination of their Contribution(s)
81 | with the Work to which such Contribution(s) was submitted. If You
82 | institute patent litigation against any entity (including a
83 | cross-claim or counterclaim in a lawsuit) alleging that the Work
84 | or a Contribution incorporated within the Work constitutes direct
85 | or contributory patent infringement, then any patent licenses
86 | granted to You under this License for that Work shall terminate
87 | as of the date such litigation is filed.
88 |
89 | 4. Redistribution. You may reproduce and distribute copies of the
90 | Work or Derivative Works thereof in any medium, with or without
91 | modifications, and in Source or Object form, provided that You
92 | meet the following conditions:
93 |
94 | (a) You must give any other recipients of the Work or
95 | Derivative Works a copy of this License; and
96 |
97 | (b) You must cause any modified files to carry prominent notices
98 | stating that You changed the files; and
99 |
100 | (c) You must retain, in the Source form of any Derivative Works
101 | that You distribute, all copyright, patent, trademark, and
102 | attribution notices from the Source form of the Work,
103 | excluding those notices that do not pertain to any part of
104 | the Derivative Works; and
105 |
106 | (d) If the Work includes a "NOTICE" text file as part of its
107 | distribution, then any Derivative Works that You distribute must
108 | include a readable copy of the attribution notices contained
109 | within such NOTICE file, excluding those notices that do not
110 | pertain to any part of the Derivative Works, in at least one
111 | of the following places: within a NOTICE text file distributed
112 | as part of the Derivative Works; within the Source form or
113 | documentation, if provided along with the Derivative Works; or,
114 | within a display generated by the Derivative Works, if and
115 | wherever such third-party notices normally appear. The contents
116 | of the NOTICE file are for informational purposes only and
117 | do not modify the License. You may add Your own attribution
118 | notices within Derivative Works that You distribute, alongside
119 | or as an addendum to the NOTICE text from the Work, provided
120 | that such additional attribution notices cannot be construed
121 | as modifying the License.
122 |
123 | You may add Your own copyright statement to Your modifications and
124 | may provide additional or different license terms and conditions
125 | for use, reproduction, or distribution of Your modifications, or
126 | for any such Derivative Works as a whole, provided Your use,
127 | reproduction, and distribution of the Work otherwise complies with
128 | the conditions stated in this License.
129 |
130 | 5. Submission of Contributions. Unless You explicitly state otherwise,
131 | any Contribution intentionally submitted for inclusion in the Work
132 | by You to the Licensor shall be under the terms and conditions of
133 | this License, without any additional terms or conditions.
134 | Notwithstanding the above, nothing herein shall supersede or modify
135 | the terms of any separate license agreement you may have executed
136 | with Licensor regarding such Contributions.
137 |
138 | 6. Trademarks. This License does not grant permission to use the trade
139 | names, trademarks, service marks, or product names of the Licensor,
140 | except as required for reasonable and customary use in describing the
141 | origin of the Work and reproducing the content of the NOTICE file.
142 |
143 | 7. Disclaimer of Warranty. Unless required by applicable law or
144 | agreed to in writing, Licensor provides the Work (and each
145 | Contributor provides its Contributions) on an "AS IS" BASIS,
146 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
147 | implied, including, without limitation, any warranties or conditions
148 | of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
149 | PARTICULAR PURPOSE. You are solely responsible for determining the
150 | appropriateness of using or redistributing the Work and assume any
151 | risks associated with Your exercise of permissions under this License.
152 |
153 | 8. Limitation of Liability. In no event and under no legal theory,
154 | whether in tort (including negligence), contract, or otherwise,
155 | unless required by applicable law (such as deliberate and grossly
156 | negligent acts) or agreed to in writing, shall any Contributor be
157 | liable to You for damages, including any direct, indirect, special,
158 | incidental, or consequential damages of any character arising as a
159 | result of this License or out of the use or inability to use the
160 | Work (including but not limited to damages for loss of goodwill,
161 | work stoppage, computer failure or malfunction, or any and all
162 | other commercial damages or losses), even if such Contributor
163 | has been advised of the possibility of such damages.
164 |
165 | 9. Accepting Warranty or Additional Liability. While redistributing
166 | the Work or Derivative Works thereof, You may choose to offer,
167 | and charge a fee for, acceptance of support, warranty, indemnity,
168 | or other liability obligations and/or rights consistent with this
169 | License. However, in accepting such obligations, You may act only
170 | on Your own behalf and on Your sole responsibility, not on behalf
171 | of any other Contributor, and only if You agree to indemnify,
172 | defend, and hold each Contributor harmless for any liability
173 | incurred by, or claims asserted against, such Contributor by reason
174 | of your accepting any such warranty or additional liability.
175 |
176 | END OF TERMS AND CONDITIONS
177 |
178 | APPENDIX: How to apply the Apache License to your work.
179 |
180 | To apply the Apache License to your work, attach the following
181 | boilerplate notice, with the fields enclosed by brackets "{}"
182 | replaced with your own identifying information. (Don't include
183 | the brackets!) The text should be enclosed in the appropriate
184 | comment syntax for the file format. We also recommend that a
185 | file or class name and description of purpose be included on the
186 | same "printed page" as the copyright notice for easier
187 | identification within third-party archives.
188 |
189 | Copyright {yyyy} {name of copyright owner}
190 |
191 | Licensed under the Apache License, Version 2.0 (the "License");
192 | you may not use this file except in compliance with the License.
193 | You may obtain a copy of the License at
194 |
195 | http://www.apache.org/licenses/LICENSE-2.0
196 |
197 | Unless required by applicable law or agreed to in writing, software
198 | distributed under the License is distributed on an "AS IS" BASIS,
199 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
200 | See the License for the specific language governing permissions and
201 | limitations under the License.
202 |
--------------------------------------------------------------------------------