diff --git a/CarouselViewChallenge/CarouselViewChallenge.Android/Assets/Fonts/Roboto-Black.ttf b/CarouselViewChallenge/CarouselViewChallenge.Android/Assets/Fonts/Roboto-Black.ttf new file mode 100644 index 0000000..51c71bb Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.Android/Assets/Fonts/Roboto-Black.ttf differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.Android/Assets/Fonts/Roboto-Bold.ttf b/CarouselViewChallenge/CarouselViewChallenge.Android/Assets/Fonts/Roboto-Bold.ttf new file mode 100644 index 0000000..e612852 Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.Android/Assets/Fonts/Roboto-Bold.ttf differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.Android/Assets/Fonts/Roboto-Light.ttf b/CarouselViewChallenge/CarouselViewChallenge.Android/Assets/Fonts/Roboto-Light.ttf new file mode 100644 index 0000000..4f1fb58 Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.Android/Assets/Fonts/Roboto-Light.ttf differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.Android/Assets/Fonts/Roboto-Medium.ttf b/CarouselViewChallenge/CarouselViewChallenge.Android/Assets/Fonts/Roboto-Medium.ttf new file mode 100644 index 0000000..86d1c52 Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.Android/Assets/Fonts/Roboto-Medium.ttf differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.Android/Assets/Fonts/Roboto-Regular.ttf b/CarouselViewChallenge/CarouselViewChallenge.Android/Assets/Fonts/Roboto-Regular.ttf new file mode 100644 index 0000000..cb8ffcf Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.Android/Assets/Fonts/Roboto-Regular.ttf differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.Android/Assets/Fonts/Roboto-Thin.ttf b/CarouselViewChallenge/CarouselViewChallenge.Android/Assets/Fonts/Roboto-Thin.ttf new file mode 100644 index 0000000..a85eb7c Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.Android/Assets/Fonts/Roboto-Thin.ttf differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.Android/Assets/Fonts/materialdesignicons-webfont.ttf b/CarouselViewChallenge/CarouselViewChallenge.Android/Assets/Fonts/materialdesignicons-webfont.ttf new file mode 100644 index 0000000..9cc8db1 Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.Android/Assets/Fonts/materialdesignicons-webfont.ttf differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.Android/CarouselViewChallenge.Android.csproj b/CarouselViewChallenge/CarouselViewChallenge.Android/CarouselViewChallenge.Android.csproj index 1e33499..2812153 100644 --- a/CarouselViewChallenge/CarouselViewChallenge.Android/CarouselViewChallenge.Android.csproj +++ b/CarouselViewChallenge/CarouselViewChallenge.Android/CarouselViewChallenge.Android.csproj @@ -54,8 +54,11 @@ - - + + + + 1.2.1 + @@ -63,6 +66,13 @@ + + + + + + + @@ -100,5 +110,17 @@ CarouselViewChallenge + + + + + + + + + + + + - + \ No newline at end of file diff --git a/CarouselViewChallenge/CarouselViewChallenge.Android/Resources/drawable/bmwlogowallpaper1.jpg b/CarouselViewChallenge/CarouselViewChallenge.Android/Resources/drawable/bmwlogowallpaper1.jpg new file mode 100644 index 0000000..367dac5 Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.Android/Resources/drawable/bmwlogowallpaper1.jpg differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.Android/Resources/drawable/bmwvisionmnextconcep1.jpg b/CarouselViewChallenge/CarouselViewChallenge.Android/Resources/drawable/bmwvisionmnextconcep1.jpg new file mode 100644 index 0000000..db5534f Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.Android/Resources/drawable/bmwvisionmnextconcep1.jpg differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.Android/Resources/drawable/bmwvisionmnextconcep2.jpg b/CarouselViewChallenge/CarouselViewChallenge.Android/Resources/drawable/bmwvisionmnextconcep2.jpg new file mode 100644 index 0000000..e7866ab Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.Android/Resources/drawable/bmwvisionmnextconcep2.jpg differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.Android/Resources/drawable/bmwvisionmnextconcep3.jpg b/CarouselViewChallenge/CarouselViewChallenge.Android/Resources/drawable/bmwvisionmnextconcep3.jpg new file mode 100644 index 0000000..d37e0f9 Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.Android/Resources/drawable/bmwvisionmnextconcep3.jpg differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.UWP/Assets/Fonts/Roboto-Black.ttf b/CarouselViewChallenge/CarouselViewChallenge.UWP/Assets/Fonts/Roboto-Black.ttf new file mode 100644 index 0000000..51c71bb Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.UWP/Assets/Fonts/Roboto-Black.ttf differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.UWP/Assets/Fonts/Roboto-Bold.ttf b/CarouselViewChallenge/CarouselViewChallenge.UWP/Assets/Fonts/Roboto-Bold.ttf new file mode 100644 index 0000000..e612852 Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.UWP/Assets/Fonts/Roboto-Bold.ttf differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.UWP/Assets/Fonts/Roboto-Light.ttf b/CarouselViewChallenge/CarouselViewChallenge.UWP/Assets/Fonts/Roboto-Light.ttf new file mode 100644 index 0000000..4f1fb58 Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.UWP/Assets/Fonts/Roboto-Light.ttf differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.UWP/Assets/Fonts/Roboto-Medium.ttf b/CarouselViewChallenge/CarouselViewChallenge.UWP/Assets/Fonts/Roboto-Medium.ttf new file mode 100644 index 0000000..86d1c52 Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.UWP/Assets/Fonts/Roboto-Medium.ttf differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.UWP/Assets/Fonts/Roboto-Regular.ttf b/CarouselViewChallenge/CarouselViewChallenge.UWP/Assets/Fonts/Roboto-Regular.ttf new file mode 100644 index 0000000..cb8ffcf Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.UWP/Assets/Fonts/Roboto-Regular.ttf differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.UWP/Assets/Fonts/Roboto-Thin.ttf b/CarouselViewChallenge/CarouselViewChallenge.UWP/Assets/Fonts/Roboto-Thin.ttf new file mode 100644 index 0000000..a85eb7c Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.UWP/Assets/Fonts/Roboto-Thin.ttf differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.UWP/Assets/Fonts/materialdesignicons-webfont.ttf b/CarouselViewChallenge/CarouselViewChallenge.UWP/Assets/Fonts/materialdesignicons-webfont.ttf new file mode 100644 index 0000000..9cc8db1 Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.UWP/Assets/Fonts/materialdesignicons-webfont.ttf differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.UWP/CarouselViewChallenge.UWP.csproj b/CarouselViewChallenge/CarouselViewChallenge.UWP/CarouselViewChallenge.UWP.csproj index 4b6b2c9..9572ac4 100644 --- a/CarouselViewChallenge/CarouselViewChallenge.UWP/CarouselViewChallenge.UWP.csproj +++ b/CarouselViewChallenge/CarouselViewChallenge.UWP/CarouselViewChallenge.UWP.csproj @@ -103,6 +103,10 @@ + + + + @@ -147,7 +151,10 @@ - + + + 1.2.1 + @@ -155,8 +162,29 @@ CarouselViewChallenge + + + + + + + + + + + + + + + + + + + + + 14.0 - + \ No newline at end of file diff --git a/CarouselViewChallenge/CarouselViewChallenge.UWP/bmwlogowallpaper1.jpg b/CarouselViewChallenge/CarouselViewChallenge.UWP/bmwlogowallpaper1.jpg new file mode 100644 index 0000000..367dac5 Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.UWP/bmwlogowallpaper1.jpg differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.UWP/bmwvisionmnextconcep1.jpg b/CarouselViewChallenge/CarouselViewChallenge.UWP/bmwvisionmnextconcep1.jpg new file mode 100644 index 0000000..db5534f Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.UWP/bmwvisionmnextconcep1.jpg differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.UWP/bmwvisionmnextconcep2.jpg b/CarouselViewChallenge/CarouselViewChallenge.UWP/bmwvisionmnextconcep2.jpg new file mode 100644 index 0000000..e7866ab Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.UWP/bmwvisionmnextconcep2.jpg differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.UWP/bmwvisionmnextconcep3.jpg b/CarouselViewChallenge/CarouselViewChallenge.UWP/bmwvisionmnextconcep3.jpg new file mode 100644 index 0000000..d37e0f9 Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.UWP/bmwvisionmnextconcep3.jpg differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.iOS/CarouselViewChallenge.iOS.csproj b/CarouselViewChallenge/CarouselViewChallenge.iOS/CarouselViewChallenge.iOS.csproj index 6241d2c..606101b 100644 --- a/CarouselViewChallenge/CarouselViewChallenge.iOS/CarouselViewChallenge.iOS.csproj +++ b/CarouselViewChallenge/CarouselViewChallenge.iOS/CarouselViewChallenge.iOS.csproj @@ -65,6 +65,13 @@ + + + + + + + @@ -130,7 +137,10 @@ - + + + 1.2.1 + @@ -139,4 +149,16 @@ CarouselViewChallenge - + + + + + + + + + + + + + \ No newline at end of file diff --git a/CarouselViewChallenge/CarouselViewChallenge.iOS/Info.plist b/CarouselViewChallenge/CarouselViewChallenge.iOS/Info.plist index 9354ef2..c8a4e8e 100644 --- a/CarouselViewChallenge/CarouselViewChallenge.iOS/Info.plist +++ b/CarouselViewChallenge/CarouselViewChallenge.iOS/Info.plist @@ -2,37 +2,47 @@ - UIDeviceFamily - - 1 - 2 - - UISupportedInterfaceOrientations - - UIInterfaceOrientationPortrait - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - UISupportedInterfaceOrientations~ipad - - UIInterfaceOrientationPortrait - UIInterfaceOrientationPortraitUpsideDown - UIInterfaceOrientationLandscapeLeft - UIInterfaceOrientationLandscapeRight - - MinimumOSVersion - 8.0 - CFBundleDisplayName - CarouselViewChallenge - CFBundleIdentifier - com.companyname.CarouselViewChallenge - CFBundleVersion - 1.0 - UILaunchStoryboardName - LaunchScreen - CFBundleName - CarouselViewChallenge - XSAppIconAssets - Assets.xcassets/AppIcon.appiconset + UIDeviceFamily + + 1 + 2 + + UISupportedInterfaceOrientations + + UIInterfaceOrientationPortrait + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + UISupportedInterfaceOrientations~ipad + + UIInterfaceOrientationPortrait + UIInterfaceOrientationPortraitUpsideDown + UIInterfaceOrientationLandscapeLeft + UIInterfaceOrientationLandscapeRight + + MinimumOSVersion + 8.0 + CFBundleDisplayName + CarouselViewChallenge + CFBundleIdentifier + com.companyname.CarouselViewChallenge + CFBundleVersion + 1.0 + UILaunchStoryboardName + LaunchScreen + CFBundleName + CarouselViewChallenge + XSAppIconAssets + Assets.xcassets/AppIcon.appiconset + UIAppFonts + + Fonts/Roboto-Bold.ttf + Fonts/Roboto-Regular.ttf + Fonts/Roboto-Medium.ttf + Fonts/Roboto-Light.ttf + Fonts/Roboto-Thin.ttf + Fonts/Roboto-Black.ttf + Fonts/materialdesignicons-webfont.ttf + diff --git a/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/Fonts/Roboto-Black.ttf b/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/Fonts/Roboto-Black.ttf new file mode 100644 index 0000000..51c71bb Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/Fonts/Roboto-Black.ttf differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/Fonts/Roboto-Bold.ttf b/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/Fonts/Roboto-Bold.ttf new file mode 100644 index 0000000..e612852 Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/Fonts/Roboto-Bold.ttf differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/Fonts/Roboto-Light.ttf b/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/Fonts/Roboto-Light.ttf new file mode 100644 index 0000000..4f1fb58 Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/Fonts/Roboto-Light.ttf differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/Fonts/Roboto-Medium.ttf b/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/Fonts/Roboto-Medium.ttf new file mode 100644 index 0000000..86d1c52 Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/Fonts/Roboto-Medium.ttf differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/Fonts/Roboto-Regular.ttf b/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/Fonts/Roboto-Regular.ttf new file mode 100644 index 0000000..cb8ffcf Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/Fonts/Roboto-Regular.ttf differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/Fonts/Roboto-Thin.ttf b/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/Fonts/Roboto-Thin.ttf new file mode 100644 index 0000000..a85eb7c Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/Fonts/Roboto-Thin.ttf differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/Fonts/materialdesignicons-webfont.ttf b/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/Fonts/materialdesignicons-webfont.ttf new file mode 100644 index 0000000..9cc8db1 Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/Fonts/materialdesignicons-webfont.ttf differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/bmwlogowallpaper1.jpg b/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/bmwlogowallpaper1.jpg new file mode 100644 index 0000000..367dac5 Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/bmwlogowallpaper1.jpg differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/bmwvisionmnextconcep1.jpg b/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/bmwvisionmnextconcep1.jpg new file mode 100644 index 0000000..db5534f Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/bmwvisionmnextconcep1.jpg differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/bmwvisionmnextconcep2.jpg b/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/bmwvisionmnextconcep2.jpg new file mode 100644 index 0000000..e7866ab Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/bmwvisionmnextconcep2.jpg differ diff --git a/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/bmwvisionmnextconcep3.jpg b/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/bmwvisionmnextconcep3.jpg new file mode 100644 index 0000000..d37e0f9 Binary files /dev/null and b/CarouselViewChallenge/CarouselViewChallenge.iOS/Resources/bmwvisionmnextconcep3.jpg differ diff --git a/CarouselViewChallenge/CarouselViewChallenge/App.xaml b/CarouselViewChallenge/CarouselViewChallenge/App.xaml index f3469f1..1899d26 100644 --- a/CarouselViewChallenge/CarouselViewChallenge/App.xaml +++ b/CarouselViewChallenge/CarouselViewChallenge/App.xaml @@ -3,8 +3,15 @@ xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" xmlns:d="http://xamarin.com/schemas/2014/forms/design" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" + xmlns:styles="clr-namespace:CarouselViewChallenge.Styles" mc:Ignorable="d" x:Class="CarouselViewChallenge.App"> + + + + + + \ No newline at end of file diff --git a/CarouselViewChallenge/CarouselViewChallenge/CarouselViewChallenge.csproj b/CarouselViewChallenge/CarouselViewChallenge/CarouselViewChallenge.csproj index a58ec88..1441a8b 100644 --- a/CarouselViewChallenge/CarouselViewChallenge/CarouselViewChallenge.csproj +++ b/CarouselViewChallenge/CarouselViewChallenge/CarouselViewChallenge.csproj @@ -7,11 +7,8 @@ - - - - - + + @@ -21,6 +18,12 @@ + + MSBuild:UpdateDesignTimeXaml + + + MSBuild:UpdateDesignTimeXaml + MSBuild:UpdateDesignTimeXaml diff --git a/CarouselViewChallenge/CarouselViewChallenge/Models/Item.cs b/CarouselViewChallenge/CarouselViewChallenge/Models/Item.cs new file mode 100644 index 0000000..0e0950e --- /dev/null +++ b/CarouselViewChallenge/CarouselViewChallenge/Models/Item.cs @@ -0,0 +1,11 @@ +namespace CarouselViewChallenge.Models +{ + public class Item + { + public string Id { get; set; } + public string Title { get; set; } + public string SubTitle { get; set; } + public string Description { get; set; } + public string ImageUrl { get; set; } + } +} diff --git a/CarouselViewChallenge/CarouselViewChallenge/Services/MockCarService.cs b/CarouselViewChallenge/CarouselViewChallenge/Services/MockCarService.cs new file mode 100644 index 0000000..24beb46 --- /dev/null +++ b/CarouselViewChallenge/CarouselViewChallenge/Services/MockCarService.cs @@ -0,0 +1,31 @@ +using System; +using System.Collections.Generic; +using CarouselViewChallenge.Models; + +namespace CarouselViewChallenge.Services +{ + public class MockCarService + { + private static MockCarService _instance; + + public static MockCarService Instance + { + get + { + if (_instance == null) + _instance = new MockCarService(); + return _instance; + } + } + + public List GetItems() + { + return new List + { + new Item { Id= Guid.NewGuid().ToString(), ImageUrl="bmwvisionmnextconcep1.jpg" , Title="BMW Vision M NEXT", SubTitle="", Description="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. " }, + new Item { Id= Guid.NewGuid().ToString(), ImageUrl="bmwvisionmnextconcep2.jpg" , Title="BMW Vision M NEXT", SubTitle="", Description="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. " }, + new Item { Id= Guid.NewGuid().ToString(), ImageUrl="bmwvisionmnextconcep3.jpg" , Title="BMW Vision M NEXT", SubTitle="", Description="Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum. " } + }; + } + } +} diff --git a/CarouselViewChallenge/CarouselViewChallenge/Styles/Colors.xaml b/CarouselViewChallenge/CarouselViewChallenge/Styles/Colors.xaml new file mode 100644 index 0000000..7d865b7 --- /dev/null +++ b/CarouselViewChallenge/CarouselViewChallenge/Styles/Colors.xaml @@ -0,0 +1,17 @@ + + + + + #000000 + #FFFFFF + + #81C4FF + #16588E + #E7222E + + \ No newline at end of file diff --git a/CarouselViewChallenge/CarouselViewChallenge/Styles/Colors.xaml.cs b/CarouselViewChallenge/CarouselViewChallenge/Styles/Colors.xaml.cs new file mode 100644 index 0000000..d8d25bb --- /dev/null +++ b/CarouselViewChallenge/CarouselViewChallenge/Styles/Colors.xaml.cs @@ -0,0 +1,13 @@ +using Xamarin.Forms; + +namespace CarouselViewChallenge.Styles +{ + + public partial class Colors : ResourceDictionary + { + public Colors() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/CarouselViewChallenge/CarouselViewChallenge/Styles/Fonts.xaml b/CarouselViewChallenge/CarouselViewChallenge/Styles/Fonts.xaml new file mode 100644 index 0000000..563337b --- /dev/null +++ b/CarouselViewChallenge/CarouselViewChallenge/Styles/Fonts.xaml @@ -0,0 +1,39 @@ + + + + + + + + + + + + \ No newline at end of file diff --git a/CarouselViewChallenge/CarouselViewChallenge/Styles/Fonts.xaml.cs b/CarouselViewChallenge/CarouselViewChallenge/Styles/Fonts.xaml.cs new file mode 100644 index 0000000..eba7bea --- /dev/null +++ b/CarouselViewChallenge/CarouselViewChallenge/Styles/Fonts.xaml.cs @@ -0,0 +1,12 @@ +using Xamarin.Forms; + +namespace CarouselViewChallenge.Styles +{ + public partial class Fonts : ResourceDictionary + { + public Fonts() + { + InitializeComponent(); + } + } +} \ No newline at end of file diff --git a/CarouselViewChallenge/CarouselViewChallenge/ViewModels/BaseViewModel.cs b/CarouselViewChallenge/CarouselViewChallenge/ViewModels/BaseViewModel.cs new file mode 100644 index 0000000..c943a8f --- /dev/null +++ b/CarouselViewChallenge/CarouselViewChallenge/ViewModels/BaseViewModel.cs @@ -0,0 +1,57 @@ +using System; +using System.Collections.Generic; +using System.ComponentModel; +using System.Runtime.CompilerServices; + +namespace CarouselViewChallenge.ViewModels +{ + public abstract class BaseViewModel : INotifyPropertyChanged + { + string title = string.Empty; + public string Title + { + get { return title; } + set { SetProperty(ref title, value); } + } + + bool isBusy = false; + public bool IsBusy + { + get { return isBusy; } + set + { + SetProperty(ref isBusy, value); + OnPropertyChanged(nameof(IsNotBusy)); + } + } + + public bool IsNotBusy => !IsBusy; + + + #region INotifyPropertyChanged + + public event PropertyChangedEventHandler PropertyChanged; + + protected void OnPropertyChanged([CallerMemberName] string propertyName = "") + { + var changed = PropertyChanged; + if (changed == null) + return; + + changed.Invoke(this, new PropertyChangedEventArgs(propertyName)); + } + + protected bool SetProperty(ref T backingStore, T value, [CallerMemberName]string propertyName = "", Action onChanged = null) + { + if (EqualityComparer.Default.Equals(backingStore, value)) + return false; + + backingStore = value; + onChanged?.Invoke(); + OnPropertyChanged(propertyName); + return true; + } + + #endregion INotifyPropertyChanged + } +} diff --git a/CarouselViewChallenge/CarouselViewChallenge/ViewModels/CarouselViewChallengeViewModel.cs b/CarouselViewChallenge/CarouselViewChallenge/ViewModels/CarouselViewChallengeViewModel.cs new file mode 100644 index 0000000..b925895 --- /dev/null +++ b/CarouselViewChallenge/CarouselViewChallenge/ViewModels/CarouselViewChallengeViewModel.cs @@ -0,0 +1,44 @@ +using System.Collections.ObjectModel; +using CarouselViewChallenge.Models; +using CarouselViewChallenge.Services; + +namespace CarouselViewChallenge.ViewModels +{ + public class CarouselViewChallengeViewModel : BaseViewModel + { + private ObservableCollection _items; + private Item _currentItem; + + public CarouselViewChallengeViewModel() + { + LoadItems(); + } + + public ObservableCollection Items + { + get { return _items; } + set + { + _items = value; + OnPropertyChanged(); + } + } + + public Item CurrentItem + { + get { return _currentItem; } + set + { + _currentItem = value; + OnPropertyChanged(); + } + } + + private void LoadItems() + { + var item = MockCarService.Instance.GetItems(); + Items = new ObservableCollection(item); + CurrentItem = Items[0]; + } + } +} diff --git a/CarouselViewChallenge/CarouselViewChallenge/Views/CarouselViewChallengePage.xaml b/CarouselViewChallenge/CarouselViewChallenge/Views/CarouselViewChallengePage.xaml index 1a7cc0d..d0fc3af 100644 --- a/CarouselViewChallenge/CarouselViewChallenge/Views/CarouselViewChallengePage.xaml +++ b/CarouselViewChallenge/CarouselViewChallenge/Views/CarouselViewChallengePage.xaml @@ -4,10 +4,176 @@ xmlns:d="http://xamarin.com/schemas/2014/forms/design" xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" mc:Ignorable="d" + xmlns:pancakeview="clr-namespace:Xamarin.Forms.PancakeView;assembly=Xamarin.Forms.PancakeView" x:Class="CarouselViewChallenge.Views.CarouselViewChallengePage"> + + + + + + - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/CarouselViewChallenge/CarouselViewChallenge/Views/CarouselViewChallengePage.xaml.cs b/CarouselViewChallenge/CarouselViewChallenge/Views/CarouselViewChallengePage.xaml.cs index 38f2e9f..48c7ff0 100644 --- a/CarouselViewChallenge/CarouselViewChallenge/Views/CarouselViewChallengePage.xaml.cs +++ b/CarouselViewChallenge/CarouselViewChallenge/Views/CarouselViewChallengePage.xaml.cs @@ -1,11 +1,7 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - + using Xamarin.Forms; using Xamarin.Forms.Xaml; +using CarouselViewChallenge.ViewModels; namespace CarouselViewChallenge.Views { @@ -15,6 +11,7 @@ public partial class CarouselViewChallengePage : ContentPage public CarouselViewChallengePage() { InitializeComponent(); + BindingContext = new CarouselViewChallengeViewModel(); } } } \ No newline at end of file