diff --git a/CollectionViewChallenge/CollectionViewChallenge.Android/CollectionViewChallenge.Android.csproj b/CollectionViewChallenge/CollectionViewChallenge.Android/CollectionViewChallenge.Android.csproj
index d2c42fc..821f524 100644
--- a/CollectionViewChallenge/CollectionViewChallenge.Android/CollectionViewChallenge.Android.csproj
+++ b/CollectionViewChallenge/CollectionViewChallenge.Android/CollectionViewChallenge.Android.csproj
@@ -106,5 +106,20 @@
CollectionViewChallenge
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/CollectionViewChallenge/CollectionViewChallenge.Android/Resources/drawable/GenericBackground.png b/CollectionViewChallenge/CollectionViewChallenge.Android/Resources/drawable/GenericBackground.png
new file mode 100644
index 0000000..9d81b3a
Binary files /dev/null and b/CollectionViewChallenge/CollectionViewChallenge.Android/Resources/drawable/GenericBackground.png differ
diff --git a/CollectionViewChallenge/CollectionViewChallenge.Android/Resources/drawable/azure.png b/CollectionViewChallenge/CollectionViewChallenge.Android/Resources/drawable/azure.png
new file mode 100644
index 0000000..5f3873b
Binary files /dev/null and b/CollectionViewChallenge/CollectionViewChallenge.Android/Resources/drawable/azure.png differ
diff --git a/CollectionViewChallenge/CollectionViewChallenge.Android/Resources/drawable/sharepoint.png b/CollectionViewChallenge/CollectionViewChallenge.Android/Resources/drawable/sharepoint.png
new file mode 100644
index 0000000..06d6a42
Binary files /dev/null and b/CollectionViewChallenge/CollectionViewChallenge.Android/Resources/drawable/sharepoint.png differ
diff --git a/CollectionViewChallenge/CollectionViewChallenge.Android/Resources/drawable/sitecore.png b/CollectionViewChallenge/CollectionViewChallenge.Android/Resources/drawable/sitecore.png
new file mode 100644
index 0000000..6978529
Binary files /dev/null and b/CollectionViewChallenge/CollectionViewChallenge.Android/Resources/drawable/sitecore.png differ
diff --git a/CollectionViewChallenge/CollectionViewChallenge.Android/Resources/drawable/xamarin.png b/CollectionViewChallenge/CollectionViewChallenge.Android/Resources/drawable/xamarin.png
new file mode 100644
index 0000000..4ff6294
Binary files /dev/null and b/CollectionViewChallenge/CollectionViewChallenge.Android/Resources/drawable/xamarin.png differ
diff --git a/CollectionViewChallenge/CollectionViewChallenge.Android/Resources/values/styles.xml b/CollectionViewChallenge/CollectionViewChallenge.Android/Resources/values/styles.xml
index 43b0a58..c6b42ae 100644
--- a/CollectionViewChallenge/CollectionViewChallenge.Android/Resources/values/styles.xml
+++ b/CollectionViewChallenge/CollectionViewChallenge.Android/Resources/values/styles.xml
@@ -20,7 +20,7 @@
- true
-
+ - true
- @style/AppCompatDialogStyle
diff --git a/CollectionViewChallenge/CollectionViewChallenge.iOS/CollectionViewChallenge.iOS.csproj b/CollectionViewChallenge/CollectionViewChallenge.iOS/CollectionViewChallenge.iOS.csproj
index 49a7105..fc1d29e 100644
--- a/CollectionViewChallenge/CollectionViewChallenge.iOS/CollectionViewChallenge.iOS.csproj
+++ b/CollectionViewChallenge/CollectionViewChallenge.iOS/CollectionViewChallenge.iOS.csproj
@@ -135,6 +135,9 @@
+
+ 3.6.0.344457
+
@@ -143,4 +146,34 @@
CollectionViewChallenge
+
+
+ MSBuild:UpdateGeneratedFiles
+ Designer
+
+
+
+
+ MSBuild:UpdateGeneratedFiles
+ Designer
+
+
+
+
+ MSBuild:UpdateGeneratedFiles
+ Designer
+
+
+
+
+ MSBuild:UpdateGeneratedFiles
+ Designer
+
+
+
+
+ MSBuild:UpdateGeneratedFiles
+ Designer
+
+
\ No newline at end of file
diff --git a/CollectionViewChallenge/CollectionViewChallenge.iOS/Resources/GenericBackground.png b/CollectionViewChallenge/CollectionViewChallenge.iOS/Resources/GenericBackground.png
new file mode 100644
index 0000000..9d81b3a
Binary files /dev/null and b/CollectionViewChallenge/CollectionViewChallenge.iOS/Resources/GenericBackground.png differ
diff --git a/CollectionViewChallenge/CollectionViewChallenge.iOS/Resources/azure.png b/CollectionViewChallenge/CollectionViewChallenge.iOS/Resources/azure.png
new file mode 100644
index 0000000..5f3873b
Binary files /dev/null and b/CollectionViewChallenge/CollectionViewChallenge.iOS/Resources/azure.png differ
diff --git a/CollectionViewChallenge/CollectionViewChallenge.iOS/Resources/sharepoint.png b/CollectionViewChallenge/CollectionViewChallenge.iOS/Resources/sharepoint.png
new file mode 100644
index 0000000..06d6a42
Binary files /dev/null and b/CollectionViewChallenge/CollectionViewChallenge.iOS/Resources/sharepoint.png differ
diff --git a/CollectionViewChallenge/CollectionViewChallenge.iOS/Resources/sitecore.png b/CollectionViewChallenge/CollectionViewChallenge.iOS/Resources/sitecore.png
new file mode 100644
index 0000000..6978529
Binary files /dev/null and b/CollectionViewChallenge/CollectionViewChallenge.iOS/Resources/sitecore.png differ
diff --git a/CollectionViewChallenge/CollectionViewChallenge.iOS/Resources/xamarin.png b/CollectionViewChallenge/CollectionViewChallenge.iOS/Resources/xamarin.png
new file mode 100644
index 0000000..4ff6294
Binary files /dev/null and b/CollectionViewChallenge/CollectionViewChallenge.iOS/Resources/xamarin.png differ
diff --git a/CollectionViewChallenge/CollectionViewChallenge/AppShell.xaml b/CollectionViewChallenge/CollectionViewChallenge/AppShell.xaml
index 9364c60..25c6110 100644
--- a/CollectionViewChallenge/CollectionViewChallenge/AppShell.xaml
+++ b/CollectionViewChallenge/CollectionViewChallenge/AppShell.xaml
@@ -1,13 +1,15 @@
-
-
+
+
-
- #2196F3
+ #2cb695
+
+
-
-
+
-
+
diff --git a/CollectionViewChallenge/CollectionViewChallenge/CollectionViewChallenge.csproj b/CollectionViewChallenge/CollectionViewChallenge/CollectionViewChallenge.csproj
index 3ccfc60..68a81c0 100644
--- a/CollectionViewChallenge/CollectionViewChallenge/CollectionViewChallenge.csproj
+++ b/CollectionViewChallenge/CollectionViewChallenge/CollectionViewChallenge.csproj
@@ -20,9 +20,4 @@
MSBuild:UpdateDesignTimeXaml
-
-
-
-
-
\ No newline at end of file
diff --git a/CollectionViewChallenge/CollectionViewChallenge/Models/CaseStudyModel.cs b/CollectionViewChallenge/CollectionViewChallenge/Models/CaseStudyModel.cs
new file mode 100644
index 0000000..699584f
--- /dev/null
+++ b/CollectionViewChallenge/CollectionViewChallenge/Models/CaseStudyModel.cs
@@ -0,0 +1,36 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+
+namespace CollectionViewChallenge.Models
+{
+ class CaseStudyModel : Xamarin.Forms.BindableObject
+ {
+ public string Icon { get; set; }
+ public string Project { get; set; }
+ public string Company { get; set; }
+ public string Quote { get; set; }
+ private bool showQuote { get; set; }
+ public bool ShowQuote
+ {
+ get
+ {
+ return showQuote;
+ }
+ set
+ {
+ showQuote = value;
+ OnPropertyChanged("ShowQuote");
+ OnPropertyChanged("ShowCompany");
+ }
+ }
+
+ public bool ShowCompany
+ {
+ get
+ {
+ return !showQuote;
+ }
+ }
+ }
+}
diff --git a/CollectionViewChallenge/CollectionViewChallenge/Models/ServiceModel.cs b/CollectionViewChallenge/CollectionViewChallenge/Models/ServiceModel.cs
new file mode 100644
index 0000000..b15833b
--- /dev/null
+++ b/CollectionViewChallenge/CollectionViewChallenge/Models/ServiceModel.cs
@@ -0,0 +1,26 @@
+using System;
+using System.Collections.Generic;
+using System.ComponentModel;
+using System.Text;
+
+namespace CollectionViewChallenge.Models
+{
+ class ServiceModel : Xamarin.Forms.BindableObject
+ {
+ public string Icon { get; set; }
+ public string Name { get; set; }
+ public string Description { get; set; }
+ private bool animate { get; set; }
+ public bool Animate {
+ get
+ {
+ return animate;
+ }
+ set
+ {
+ animate = value;
+ OnPropertyChanged("Animate");
+ }
+ }
+ }
+}
diff --git a/CollectionViewChallenge/CollectionViewChallenge/Triggers/CaseStudySelectedTriggerAction.cs b/CollectionViewChallenge/CollectionViewChallenge/Triggers/CaseStudySelectedTriggerAction.cs
new file mode 100644
index 0000000..c9cf5e3
--- /dev/null
+++ b/CollectionViewChallenge/CollectionViewChallenge/Triggers/CaseStudySelectedTriggerAction.cs
@@ -0,0 +1,24 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using Xamarin.Forms;
+
+namespace CollectionViewChallenge.Triggers
+{
+ public class CaseStudySelectedTriggerAction : TriggerAction
+ {
+ public CaseStudySelectedTriggerAction() { }
+
+ public double Degrees { get; set; }
+
+ protected override void Invoke(Frame cell)
+ {
+ Animation(cell);
+ }
+
+ private async void Animation(Frame cell)
+ {
+ await cell.RotateXTo(Degrees, 400);
+ }
+ }
+}
\ No newline at end of file
diff --git a/CollectionViewChallenge/CollectionViewChallenge/Triggers/ServiceSelectedTriggerAction.cs b/CollectionViewChallenge/CollectionViewChallenge/Triggers/ServiceSelectedTriggerAction.cs
new file mode 100644
index 0000000..1063bea
--- /dev/null
+++ b/CollectionViewChallenge/CollectionViewChallenge/Triggers/ServiceSelectedTriggerAction.cs
@@ -0,0 +1,27 @@
+using System;
+using System.Collections.Generic;
+using System.Text;
+using System.Threading.Tasks;
+using Xamarin.Forms;
+
+namespace CollectionViewChallenge.Triggers
+{
+ public class ServiceSelectedTriggerAction : TriggerAction
+ {
+ public ServiceSelectedTriggerAction() { }
+
+ public double Scale { get; set; }
+
+ protected override void Invoke(Grid service)
+ {
+ Animation(service);
+ }
+
+ private async void Animation(Grid service)
+ {
+
+ await service.ScaleTo(Scale, 400);
+ await service.ScaleTo(1, 400);
+ }
+ }
+}
diff --git a/CollectionViewChallenge/CollectionViewChallenge/ViewModels/ServicePageViewModel.cs b/CollectionViewChallenge/CollectionViewChallenge/ViewModels/ServicePageViewModel.cs
new file mode 100644
index 0000000..f565e85
--- /dev/null
+++ b/CollectionViewChallenge/CollectionViewChallenge/ViewModels/ServicePageViewModel.cs
@@ -0,0 +1,110 @@
+using CollectionViewChallenge.Models;
+using System;
+using System.Collections.Generic;
+using System.Collections.ObjectModel;
+using System.ComponentModel;
+using System.Text;
+using Xamarin.Forms;
+
+namespace CollectionViewChallenge.ViewModels
+{
+ class ServicePageViewModel : Xamarin.Forms.BindableObject
+ {
+ public ServicePageViewModel()
+ {
+ selectedService = ServiceList[0];
+ selectedCaseStudy = CaseStudyList[0];
+ }
+
+ private ObservableCollection serviceList { get; set; }
+
+ public ObservableCollection ServiceList
+ {
+ get
+ {
+ return serviceList ?? (serviceList = FakeServiceList());
+ }
+ }
+
+ private ObservableCollection FakeServiceList()
+ {
+ var fakeList = new ObservableCollection();
+
+ fakeList.Add(new ServiceModel() { Name = "Xamarin", Description="Mobile solution", Icon= "xamarin.png" });
+ fakeList.Add(new ServiceModel() { Name = "Sitecore", Description = "Web solution", Icon = "sitecore.png" });
+ fakeList.Add(new ServiceModel() { Name = "SharePoint", Description = "Intranet solution", Icon = "sharepoint.png" });
+ fakeList.Add(new ServiceModel() { Name = "Azure", Description = "Cloud solution", Icon = "azure.png" });
+
+ return fakeList;
+ }
+ private ObservableCollection caseStudyList { get; set; }
+
+ public ObservableCollection CaseStudyList
+ {
+ get
+ {
+ return caseStudyList ?? (caseStudyList = FakeCaseStudyList(ServiceList[0].Name, ServiceList[0].Icon));
+ }
+ set
+ {
+ caseStudyList = value;
+ OnPropertyChanged("CaseStudyList");
+ }
+ }
+
+ private ObservableCollection FakeCaseStudyList(string service, string image)
+ {
+ var fakeList = new ObservableCollection();
+
+ Random random = new Random();
+ int num = random.Next(3, 10);
+
+ for (int i = 1; i < num; i++)
+ {
+ fakeList.Add(new CaseStudyModel() { Project = string.Format("{0} - Proyect {1}", service, i), Quote = "\"Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua.\"", Icon = image, Company = string.Format("Company {0}", i) });
+ }
+
+ return fakeList;
+ }
+
+ private ServiceModel selectedService;
+
+ public ServiceModel SelectedService
+ {
+ get
+ {
+ return selectedService;
+ }
+ set
+ {
+ if (selectedService != value)
+ {
+ selectedService.Animate = false;
+ selectedService = value;
+ selectedService.Animate = true;
+ MessagingCenter.Send(this, "ScrollToSelectedService", serviceList.IndexOf(selectedService));
+ CaseStudyList = FakeCaseStudyList(selectedService.Name, SelectedService.Icon);
+ }
+ }
+ }
+
+ private CaseStudyModel selectedCaseStudy;
+
+ public CaseStudyModel SelectedCaseStudy
+ {
+ get
+ {
+ return selectedCaseStudy;
+ }
+ set
+ {
+ if (selectedCaseStudy != value)
+ {
+ selectedCaseStudy.ShowQuote = false;
+ selectedCaseStudy = value;
+ selectedCaseStudy.ShowQuote = true;
+ }
+ }
+ }
+ }
+}
diff --git a/CollectionViewChallenge/CollectionViewChallenge/Views/CollectionViewChallengePage.xaml b/CollectionViewChallenge/CollectionViewChallenge/Views/CollectionViewChallengePage.xaml
index f2da7f7..e739e0b 100644
--- a/CollectionViewChallenge/CollectionViewChallenge/Views/CollectionViewChallengePage.xaml
+++ b/CollectionViewChallenge/CollectionViewChallenge/Views/CollectionViewChallengePage.xaml
@@ -1,29 +1,160 @@
-
+
+
+
+
+
+
+
-
-
-
-
-
- This is a CollectionView!
- Your feedback on the experience of converting a ListView to a CollectionView is incredibly appreciated.
- Here are three general questions:
- 1. How was the experience of converting your existing ListView to a CollectionView?
- 2. How is the performance compared to the ListView?
- 3. Is there a specific piece of functionality that you'd like to see?
-
-
+
+
+
+
+
+
+
+ Horizontal
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Vertical
+
+
+
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/CollectionViewChallenge/CollectionViewChallenge/Views/CollectionViewChallengePage.xaml.cs b/CollectionViewChallenge/CollectionViewChallenge/Views/CollectionViewChallengePage.xaml.cs
index 701124f..a0c38ee 100644
--- a/CollectionViewChallenge/CollectionViewChallenge/Views/CollectionViewChallengePage.xaml.cs
+++ b/CollectionViewChallenge/CollectionViewChallenge/Views/CollectionViewChallengePage.xaml.cs
@@ -1,4 +1,6 @@
-using System;
+using CollectionViewChallenge.Models;
+using CollectionViewChallenge.ViewModels;
+using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
@@ -15,6 +17,12 @@ public partial class CollectionViewChallengePage : ContentPage
public CollectionViewChallengePage()
{
InitializeComponent();
+ MessagingCenter.Subscribe(this, "ScrollToSelectedService", ScrollToSelectedService);
+ }
+
+ async void ScrollToSelectedService(ServicePageViewModel sender, int arg)
+ {
+ ServiceCollection.ScrollTo(arg, position: ScrollToPosition.Center);
}
}
}
\ No newline at end of file